]>
Commit | Line | Data |
---|---|---|
0dbd6262 SC |
1 | ///////////////////////////////////////////////////////////////////////////// |
2 | // Name: toolbar.h | |
3 | // Purpose: wxToolBar class | |
a31a5f85 | 4 | // Author: Stefan Csomor |
0dbd6262 | 5 | // Modified by: |
a31a5f85 | 6 | // Created: 1998-01-01 |
0dbd6262 | 7 | // RCS-ID: $Id$ |
a31a5f85 | 8 | // Copyright: (c) Stefan Csomor |
e40298d5 | 9 | // Licence: wxWindows licence |
0dbd6262 SC |
10 | ///////////////////////////////////////////////////////////////////////////// |
11 | ||
12 | #ifndef _WX_TOOLBAR_H_ | |
13 | #define _WX_TOOLBAR_H_ | |
14 | ||
12028905 | 15 | #if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) |
0dbd6262 SC |
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 | 23 | |
c4e41ce3 | 24 | WXDLLEXPORT_DATA(extern const wxChar*) wxToolBarNameStr; |
0dbd6262 SC |
25 | |
26 | class WXDLLEXPORT wxToolBar: public wxToolBarBase | |
27 | { | |
28 | DECLARE_DYNAMIC_CLASS(wxToolBar) | |
29 | public: | |
30 | /* | |
31 | * Public interface | |
32 | */ | |
33 | ||
bfe9ffbc | 34 | wxToolBar() { 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) | |
0dbd6262 | 41 | { |
4765d335 | 42 | Init(); |
0dbd6262 SC |
43 | Create(parent, id, pos, size, style, name); |
44 | } | |
45 | ~wxToolBar(); | |
46 | ||
47 | bool Create(wxWindow *parent, wxWindowID id, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, | |
48 | long style = wxNO_BORDER|wxTB_HORIZONTAL, | |
49 | const wxString& name = wxToolBarNameStr); | |
50 | ||
4765d335 SC |
51 | // override/implement base class virtuals |
52 | virtual wxToolBarToolBase *FindToolForPosition(wxCoord x, wxCoord y) const; | |
0dbd6262 | 53 | |
4765d335 | 54 | virtual bool Realize(); |
0dbd6262 | 55 | |
4765d335 SC |
56 | virtual void SetToolBitmapSize(const wxSize& size); |
57 | virtual wxSize GetToolSize() const; | |
0dbd6262 | 58 | |
4765d335 | 59 | virtual void SetRows(int nRows); |
0dbd6262 SC |
60 | |
61 | // Add all the buttons | |
0dbd6262 | 62 | |
69b85ca4 | 63 | virtual void MacHandleControlClick( WXWidget control , wxInt16 controlpart , bool mouseStillDown ) ; |
e40298d5 JS |
64 | virtual wxString MacGetToolTipString( wxPoint &where ) ; |
65 | void OnPaint(wxPaintEvent& event) ; | |
66 | void OnMouse(wxMouseEvent& event) ; | |
67 | virtual void MacSuperChangedPosition() ; | |
0dbd6262 | 68 | protected: |
4765d335 SC |
69 | // common part of all ctors |
70 | void Init(); | |
71 | ||
72 | // implement base class pure virtuals | |
73 | virtual bool DoInsertTool(size_t pos, wxToolBarToolBase *tool); | |
74 | virtual bool DoDeleteTool(size_t pos, wxToolBarToolBase *tool); | |
75 | ||
76 | virtual void DoEnableTool(wxToolBarToolBase *tool, bool enable); | |
77 | virtual void DoToggleTool(wxToolBarToolBase *tool, bool toggle); | |
78 | virtual void DoSetToggle(wxToolBarToolBase *tool, bool toggle); | |
79 | ||
80 | virtual wxToolBarToolBase *CreateTool(int id, | |
27e2d606 GD |
81 | const wxString& label, |
82 | const wxBitmap& bmpNormal, | |
83 | const wxBitmap& bmpDisabled, | |
84 | wxItemKind kind, | |
4765d335 | 85 | wxObject *clientData, |
27e2d606 GD |
86 | const wxString& shortHelp, |
87 | const wxString& longHelp); | |
4765d335 SC |
88 | virtual wxToolBarToolBase *CreateTool(wxControl *control); |
89 | ||
e40298d5 | 90 | DECLARE_EVENT_TABLE() |
0dbd6262 SC |
91 | }; |
92 | ||
519cb848 SC |
93 | #endif // wxUSE_TOOLBAR |
94 | ||
0dbd6262 SC |
95 | #endif |
96 | // _WX_TOOLBAR_H_ |