]>
Commit | Line | Data |
---|---|---|
0dbd6262 SC |
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 | ||
519cb848 SC |
19 | #if wxUSE_TOOLBAR |
20 | ||
0dbd6262 | 21 | #include "wx/tbarbase.h" |
519cb848 | 22 | #include "wx/dynarray.h" |
0dbd6262 SC |
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 | ||
d84afea9 | 34 | wxToolBar() : m_macToolHandles() { Init(); } |
4765d335 | 35 | |
0dbd6262 | 36 | |
d84afea9 GD |
37 | inline wxToolBar(wxWindow *parent, wxWindowID id, |
38 | const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, | |
39 | long style = wxNO_BORDER|wxTB_HORIZONTAL, | |
40 | const wxString& name = wxToolBarNameStr) | |
41 | : m_macToolHandles() | |
0dbd6262 | 42 | { |
4765d335 | 43 | Init(); |
0dbd6262 SC |
44 | Create(parent, id, pos, size, style, name); |
45 | } | |
46 | ~wxToolBar(); | |
47 | ||
48 | bool Create(wxWindow *parent, wxWindowID id, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, | |
49 | long style = wxNO_BORDER|wxTB_HORIZONTAL, | |
50 | const wxString& name = wxToolBarNameStr); | |
51 | ||
4765d335 SC |
52 | // override/implement base class virtuals |
53 | virtual wxToolBarToolBase *FindToolForPosition(wxCoord x, wxCoord y) const; | |
0dbd6262 | 54 | |
4765d335 | 55 | virtual bool Realize(); |
0dbd6262 | 56 | |
4765d335 SC |
57 | virtual void SetToolBitmapSize(const wxSize& size); |
58 | virtual wxSize GetToolSize() const; | |
0dbd6262 | 59 | |
4765d335 | 60 | virtual void SetRows(int nRows); |
0dbd6262 SC |
61 | |
62 | // Add all the buttons | |
0dbd6262 | 63 | |
5273bf2f | 64 | virtual void MacHandleControlClick( WXWidget control , short controlpart ) ; |
05adb9d2 SC |
65 | virtual wxString MacGetToolTipString( wxPoint &where ) ; |
66 | void OnPaint(wxPaintEvent& event) ; | |
67 | void OnMouse(wxMouseEvent& event) ; | |
c257d44d | 68 | virtual void MacSuperChangedPosition() ; |
0dbd6262 | 69 | protected: |
4765d335 SC |
70 | // common part of all ctors |
71 | void Init(); | |
72 | ||
73 | // implement base class pure virtuals | |
74 | virtual bool DoInsertTool(size_t pos, wxToolBarToolBase *tool); | |
75 | virtual bool DoDeleteTool(size_t pos, wxToolBarToolBase *tool); | |
76 | ||
77 | virtual void DoEnableTool(wxToolBarToolBase *tool, bool enable); | |
78 | virtual void DoToggleTool(wxToolBarToolBase *tool, bool toggle); | |
79 | virtual void DoSetToggle(wxToolBarToolBase *tool, bool toggle); | |
80 | ||
81 | virtual wxToolBarToolBase *CreateTool(int id, | |
27e2d606 GD |
82 | const wxString& label, |
83 | const wxBitmap& bmpNormal, | |
84 | const wxBitmap& bmpDisabled, | |
85 | wxItemKind kind, | |
4765d335 | 86 | wxObject *clientData, |
27e2d606 GD |
87 | const wxString& shortHelp, |
88 | const wxString& longHelp); | |
4765d335 SC |
89 | virtual wxToolBarToolBase *CreateTool(wxControl *control); |
90 | ||
519cb848 | 91 | wxArrayPtrVoid m_macToolHandles ; |
0dbd6262 | 92 | |
4765d335 | 93 | DECLARE_EVENT_TABLE() |
0dbd6262 SC |
94 | }; |
95 | ||
519cb848 SC |
96 | #endif // wxUSE_TOOLBAR |
97 | ||
0dbd6262 SC |
98 | #endif |
99 | // _WX_TOOLBAR_H_ |