]>
Commit | Line | Data |
---|---|---|
8cf73271 | 1 | ///////////////////////////////////////////////////////////////////////////// |
1b88201f | 2 | // Name: wx/mac/carbon/toolbar.h |
8cf73271 SC |
3 | // Purpose: wxToolBar class |
4 | // Author: Stefan Csomor | |
5 | // Modified by: | |
6 | // Created: 1998-01-01 | |
7 | // RCS-ID: $Id$ | |
8 | // Copyright: (c) Stefan Csomor | |
65571936 | 9 | // Licence: wxWindows licence |
8cf73271 SC |
10 | ///////////////////////////////////////////////////////////////////////////// |
11 | ||
12 | #ifndef _WX_TOOLBAR_H_ | |
13 | #define _WX_TOOLBAR_H_ | |
14 | ||
8cf73271 SC |
15 | #if wxUSE_TOOLBAR |
16 | ||
17 | #include "wx/tbarbase.h" | |
18 | #include "wx/dynarray.h" | |
19 | ||
53a2db12 | 20 | WXDLLIMPEXP_DATA_CORE(extern const char) wxToolBarNameStr[]; |
8cf73271 | 21 | |
53a2db12 | 22 | class WXDLLIMPEXP_CORE wxToolBar: public wxToolBarBase |
8cf73271 SC |
23 | { |
24 | DECLARE_DYNAMIC_CLASS(wxToolBar) | |
25 | public: | |
26 | /* | |
27 | * Public interface | |
28 | */ | |
29 | ||
30 | wxToolBar() { Init(); } | |
31 | ||
8cf73271 SC |
32 | inline wxToolBar(wxWindow *parent, wxWindowID id, |
33 | const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, | |
34 | long style = wxNO_BORDER|wxTB_HORIZONTAL, | |
35 | const wxString& name = wxToolBarNameStr) | |
36 | { | |
37 | Init(); | |
38 | Create(parent, id, pos, size, style, name); | |
39 | } | |
d3c7fc99 | 40 | virtual ~wxToolBar(); |
8cf73271 SC |
41 | |
42 | bool Create(wxWindow *parent, wxWindowID id, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, | |
43 | long style = wxNO_BORDER|wxTB_HORIZONTAL, | |
44 | const wxString& name = wxToolBarNameStr); | |
45 | ||
e56d2520 SC |
46 | virtual void SetWindowStyleFlag(long style); |
47 | ||
8cf73271 SC |
48 | // override/implement base class virtuals |
49 | virtual wxToolBarToolBase *FindToolForPosition(wxCoord x, wxCoord y) const; | |
50 | ||
e56d2520 SC |
51 | virtual bool Show(bool show = true); |
52 | virtual bool IsShown() const; | |
8cf73271 SC |
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 | ||
bbd321ff RD |
60 | virtual void SetToolNormalBitmap(int id, const wxBitmap& bitmap); |
61 | virtual void SetToolDisabledBitmap(int id, const wxBitmap& bitmap); | |
62 | ||
63 | // Add all the buttons | |
8cf73271 | 64 | |
8cf73271 SC |
65 | virtual wxString MacGetToolTipString( wxPoint &where ) ; |
66 | void OnPaint(wxPaintEvent& event) ; | |
67 | void OnMouse(wxMouseEvent& event) ; | |
68 | virtual void MacSuperChangedPosition() ; | |
e56d2520 SC |
69 | |
70 | #if wxMAC_USE_NATIVE_TOOLBAR | |
71 | bool MacInstallNativeToolbar(bool usesNative); | |
72 | bool MacWantsNativeToolbar(); | |
73 | bool MacTopLevelHasNativeToolbar(bool *ownToolbarInstalled) const; | |
74 | #endif | |
8cf73271 SC |
75 | protected: |
76 | // common part of all ctors | |
77 | void Init(); | |
78 | ||
6f02a879 VZ |
79 | virtual void DoGetSize(int *width, int *height) const; |
80 | virtual wxSize DoGetBestSize() const; | |
8cf73271 SC |
81 | virtual bool DoInsertTool(size_t pos, wxToolBarToolBase *tool); |
82 | virtual bool DoDeleteTool(size_t pos, wxToolBarToolBase *tool); | |
83 | ||
84 | virtual void DoEnableTool(wxToolBarToolBase *tool, bool enable); | |
85 | virtual void DoToggleTool(wxToolBarToolBase *tool, bool toggle); | |
86 | virtual void DoSetToggle(wxToolBarToolBase *tool, bool toggle); | |
87 | ||
88 | virtual wxToolBarToolBase *CreateTool(int id, | |
89 | const wxString& label, | |
90 | const wxBitmap& bmpNormal, | |
91 | const wxBitmap& bmpDisabled, | |
92 | wxItemKind kind, | |
93 | wxObject *clientData, | |
94 | const wxString& shortHelp, | |
95 | const wxString& longHelp); | |
cdb11cb9 VZ |
96 | virtual wxToolBarToolBase *CreateTool(wxControl *control, |
97 | const wxString& label); | |
8cf73271 SC |
98 | |
99 | DECLARE_EVENT_TABLE() | |
1b88201f WS |
100 | #if wxMAC_USE_NATIVE_TOOLBAR |
101 | bool m_macUsesNativeToolbar ; | |
102 | void* m_macHIToolbarRef ; | |
e56d2520 | 103 | #endif |
8cf73271 SC |
104 | }; |
105 | ||
106 | #endif // wxUSE_TOOLBAR | |
107 | ||
108 | #endif | |
109 | // _WX_TOOLBAR_H_ |