]>
Commit | Line | Data |
---|---|---|
7c23a0b0 JS |
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 | #include "wx/tbarbase.h" | |
20 | ||
21 | WXDLLEXPORT_DATA(extern const char*) wxToolBarNameStr; | |
22 | ||
23 | class WXDLLEXPORT wxToolBar: public wxToolBarBase | |
24 | { | |
25 | DECLARE_DYNAMIC_CLASS(wxToolBar) | |
26 | public: | |
27 | /* | |
28 | * Public interface | |
29 | */ | |
30 | ||
31 | wxToolBar(); | |
32 | ||
33 | inline wxToolBar(wxWindow *parent, wxWindowID id, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, | |
34 | long style = wxNO_BORDER|wxTB_HORIZONTAL, | |
35 | const wxString& name = wxToolBarNameStr) | |
36 | { | |
37 | Create(parent, id, pos, size, style, name); | |
38 | } | |
39 | ~wxToolBar(); | |
40 | ||
41 | bool Create(wxWindow *parent, wxWindowID id, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, | |
42 | long style = wxNO_BORDER|wxTB_HORIZONTAL, | |
43 | const wxString& name = wxToolBarNameStr); | |
44 | ||
45 | // If pushedBitmap is NULL, a reversed version of bitmap is | |
46 | // created and used as the pushed/toggled image. | |
47 | // If toggle is TRUE, the button toggles between the two states. | |
48 | wxToolBarTool *AddTool(int toolIndex, const wxBitmap& bitmap, const wxBitmap& pushedBitmap = wxNullBitmap, | |
49 | bool toggle = FALSE, long xPos = -1, long yPos = -1, wxObject *clientData = NULL, | |
50 | const wxString& helpString1 = "", const wxString& helpString2 = ""); | |
51 | ||
52 | // Set default bitmap size | |
53 | void SetToolBitmapSize(const wxSize& size); | |
54 | void EnableTool(int toolIndex, bool enable); // additional drawing on enabling | |
55 | void ToggleTool(int toolIndex, bool toggle); // toggle is TRUE if toggled on | |
56 | void ClearTools(); | |
57 | ||
58 | // The button size is bigger than the bitmap size | |
59 | wxSize GetToolSize() const; | |
60 | ||
61 | wxSize GetMaxSize() const; | |
62 | void GetSize(int *w, int *y) const; | |
63 | ||
64 | // Add all the buttons: required for Win. | |
65 | virtual bool CreateTools(); | |
66 | virtual void SetRows(int nRows); | |
67 | virtual void Layout() {} | |
68 | ||
69 | // The post-tool-addition call | |
70 | bool Realize() { return CreateTools(); }; | |
71 | ||
72 | protected: | |
73 | ||
74 | DECLARE_EVENT_TABLE() | |
75 | }; | |
76 | ||
77 | #endif | |
78 | // _WX_TOOLBAR_H_ |