]> git.saurik.com Git - wxWidgets.git/blob - include/wx/mac/toolbar.h
Integrated recent API-change
[wxWidgets.git] / include / wx / mac / toolbar.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: toolbar.h
3 // Purpose: wxToolBar class
4 // Author: AUTHOR
5 // Modified by:
6 // Created: ??/??/98
7 // RCS-ID: $Id$
8 // Copyright: (c) AUTHOR
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
11
12 #ifndef _WX_TOOLBAR_H_
13 #define _WX_TOOLBAR_H_
14
15 #ifdef __GNUG__
16 #pragma interface "toolbar.h"
17 #endif
18
19 #if wxUSE_TOOLBAR
20
21 #include "wx/tbarbase.h"
22 #include "wx/dynarray.h"
23
24 WXDLLEXPORT_DATA(extern const char*) wxToolBarNameStr;
25
26 class WXDLLEXPORT wxToolBar: public wxToolBarBase
27 {
28 DECLARE_DYNAMIC_CLASS(wxToolBar)
29 public:
30 /*
31 * Public interface
32 */
33
34 wxToolBar() { Init(); }
35
36
37 inline wxToolBar(wxWindow *parent, wxWindowID id, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
38 long style = wxNO_BORDER|wxTB_HORIZONTAL,
39 const wxString& name = wxToolBarNameStr)
40 {
41 Init();
42 Create(parent, id, pos, size, style, name);
43 }
44 ~wxToolBar();
45
46 bool Create(wxWindow *parent, wxWindowID id, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
47 long style = wxNO_BORDER|wxTB_HORIZONTAL,
48 const wxString& name = wxToolBarNameStr);
49
50 // override/implement base class virtuals
51 virtual wxToolBarToolBase *FindToolForPosition(wxCoord x, wxCoord y) const;
52
53 virtual bool Realize();
54
55 virtual void SetToolBitmapSize(const wxSize& size);
56 virtual wxSize GetToolSize() const;
57
58 virtual void SetRows(int nRows);
59
60 // Add all the buttons
61
62 virtual void MacHandleControlClick( ControlHandle control , SInt16 controlpart ) ;
63 protected:
64 // common part of all ctors
65 void Init();
66
67 // implement base class pure virtuals
68 virtual bool DoInsertTool(size_t pos, wxToolBarToolBase *tool);
69 virtual bool DoDeleteTool(size_t pos, wxToolBarToolBase *tool);
70
71 virtual void DoEnableTool(wxToolBarToolBase *tool, bool enable);
72 virtual void DoToggleTool(wxToolBarToolBase *tool, bool toggle);
73 virtual void DoSetToggle(wxToolBarToolBase *tool, bool toggle);
74
75 virtual wxToolBarToolBase *CreateTool(int id,
76 const wxBitmap& bitmap1,
77 const wxBitmap& bitmap2,
78 bool toggle,
79 wxObject *clientData,
80 const wxString& shortHelpString,
81 const wxString& longHelpString);
82 virtual wxToolBarToolBase *CreateTool(wxControl *control);
83
84 wxArrayPtrVoid m_macToolHandles ;
85
86 DECLARE_EVENT_TABLE()
87 };
88
89 #endif // wxUSE_TOOLBAR
90
91 #endif
92 // _WX_TOOLBAR_H_