]> git.saurik.com Git - wxWidgets.git/blame - include/wx/cocoa/toolbar.h
allow compilation with wxUSE_CHOICEDLG set to 0
[wxWidgets.git] / include / wx / cocoa / toolbar.h
CommitLineData
7dafb55f
DE
1/////////////////////////////////////////////////////////////////////////////
2// Name: wx/cocoa/toolbar.h
3// Purpose: wxToolBar
4// Author: David Elliott
5// Modified by:
6// Created: 2003/08/17
7// RCS-ID: $Id$
8// Copyright: (c) 2003 David Elliott
65571936 9// Licence: wxWindows licence
7dafb55f
DE
10/////////////////////////////////////////////////////////////////////////////
11
12#ifndef __WX_COCOA_TOOLBAR_H__
13#define __WX_COCOA_TOOLBAR_H__
14
15#if wxUSE_TOOLBAR
16
17// ========================================================================
18// wxToolBar
19// ========================================================================
20typedef struct _NSPoint NSPoint;
21class wxToolBarTool;
22
23class wxToolBar : public wxToolBarBase
24{
25 DECLARE_DYNAMIC_CLASS(wxToolBar)
26// ------------------------------------------------------------------------
27// initialization
28// ------------------------------------------------------------------------
29public:
30 wxToolBar() { Init(); }
31 wxToolBar( wxWindow *parent,
32 wxWindowID toolid,
33 const wxPoint& pos = wxDefaultPosition,
34 const wxSize& size = wxDefaultSize,
35 long style = 0,
36 const wxString& name = wxToolBarNameStr )
37 {
38 Init();
39
40 Create(parent, toolid, pos, size, style, name);
41 }
42
43 bool Create( wxWindow *parent,
44 wxWindowID toolid,
45 const wxPoint& pos = wxDefaultPosition,
46 const wxSize& size = wxDefaultSize,
47 long style = 0,
48 const wxString& name = wxToolBarNameStr );
49
50 virtual ~wxToolBar();
51
52protected:
53 // common part of all ctors
54 void Init();
55
56// ------------------------------------------------------------------------
57// Cocoa
58// ------------------------------------------------------------------------
59protected:
60 virtual bool Cocoa_drawRect(const NSRect &rect);
61 virtual bool Cocoa_mouseDown(WX_NSEvent theEvent);
62 virtual bool Cocoa_mouseDragged(WX_NSEvent theEvent);
63 wxToolBarTool *CocoaFindToolForPosition(const NSPoint& pos) const;
64// ------------------------------------------------------------------------
65// Implementation
66// ------------------------------------------------------------------------
67public:
68 // override base class virtuals
69 virtual void SetMargins(int x, int y);
70 virtual void SetToolSeparation(int separation);
71
72 virtual wxToolBarToolBase *FindToolForPosition(wxCoord x, wxCoord y) const;
73
74 virtual void SetToolShortHelp(int toolid, const wxString& helpString);
75
76 virtual void SetWindowStyleFlag( long style );
77
78 // implementation from now on
79 // --------------------------
80
81 void OnInternalIdle();
82 virtual bool Realize();
83 virtual wxSize DoGetBestSize() const;
84
85 void SetOwningFrame(wxFrame *owningFrame)
86 { m_owningFrame = owningFrame; }
87protected:
88 // implement base class pure virtuals
89 virtual bool DoInsertTool(size_t pos, wxToolBarToolBase *tool);
90 virtual bool DoDeleteTool(size_t pos, wxToolBarToolBase *tool);
91
92 virtual void DoEnableTool(wxToolBarToolBase *tool, bool enable);
93 virtual void DoToggleTool(wxToolBarToolBase *tool, bool toggle);
94 virtual void DoSetToggle(wxToolBarToolBase *tool, bool toggle);
95
96 virtual wxToolBarToolBase *CreateTool(int toolid,
97 const wxString& label,
98 const wxBitmap& bitmap1,
99 const wxBitmap& bitmap2,
100 wxItemKind kind,
101 wxObject *clientData,
102 const wxString& shortHelpString,
103 const wxString& longHelpString);
104 virtual wxToolBarToolBase *CreateTool(wxControl *control);
105
106 wxSize m_bestSize;
107 wxFrame *m_owningFrame;
108 wxToolBarTool *m_mouseDownTool;
109};
110
111#endif // wxUSE_TOOLBAR
112
113#endif // __WX_COCOA_TOOLBAR_H__