]>
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 | ||
34 | wxToolBar(); | |
35 | ||
36 | inline wxToolBar(wxWindow *parent, wxWindowID id, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, | |
37 | long style = wxNO_BORDER|wxTB_HORIZONTAL, | |
38 | const wxString& name = wxToolBarNameStr) | |
39 | { | |
40 | Create(parent, id, pos, size, style, name); | |
41 | } | |
42 | ~wxToolBar(); | |
43 | ||
44 | bool Create(wxWindow *parent, wxWindowID id, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, | |
45 | long style = wxNO_BORDER|wxTB_HORIZONTAL, | |
46 | const wxString& name = wxToolBarNameStr); | |
47 | ||
48 | // If pushedBitmap is NULL, a reversed version of bitmap is | |
49 | // created and used as the pushed/toggled image. | |
50 | // If toggle is TRUE, the button toggles between the two states. | |
51 | wxToolBarTool *AddTool(int toolIndex, const wxBitmap& bitmap, const wxBitmap& pushedBitmap = wxNullBitmap, | |
52 | bool toggle = FALSE, long xPos = -1, long yPos = -1, wxObject *clientData = NULL, | |
53 | const wxString& helpString1 = "", const wxString& helpString2 = ""); | |
54 | ||
55 | // Set default bitmap size | |
56 | void SetToolBitmapSize(const wxSize& size); | |
57 | void EnableTool(int toolIndex, bool enable); // additional drawing on enabling | |
58 | void ToggleTool(int toolIndex, bool toggle); // toggle is TRUE if toggled on | |
59 | void ClearTools(); | |
60 | ||
61 | // The button size is bigger than the bitmap size | |
62 | wxSize GetToolSize() const; | |
63 | ||
64 | wxSize GetMaxSize() const; | |
65 | ||
66 | // Add all the buttons | |
67 | virtual bool CreateTools(); | |
519cb848 | 68 | virtual void LayoutButtons() {} |
0dbd6262 SC |
69 | |
70 | // The post-tool-addition call. TODO: do here whatever's | |
71 | // necessary for completing the toolbar construction. | |
72 | bool Realize() { return CreateTools(); }; | |
519cb848 | 73 | virtual void MacHandleControlClick( ControlHandle control , SInt16 controlpart ) ; |
0dbd6262 | 74 | protected: |
519cb848 | 75 | wxArrayPtrVoid m_macToolHandles ; |
0dbd6262 SC |
76 | |
77 | DECLARE_EVENT_TABLE() | |
78 | }; | |
79 | ||
519cb848 SC |
80 | #endif // wxUSE_TOOLBAR |
81 | ||
0dbd6262 SC |
82 | #endif |
83 | // _WX_TOOLBAR_H_ |