]>
Commit | Line | Data |
---|---|---|
6d167489 VZ |
1 | ///////////////////////////////////////////////////////////////////////////// |
2 | // Name: wx/toolbar.h | |
3 | // Purpose: wxToolBar interface declaration | |
4 | // Author: Vadim Zeitlin | |
5 | // Modified by: | |
6 | // Created: 20.11.99 | |
7 | // RCS-ID: $Id$ | |
8 | // Copyright: (c) wxWindows team | |
9 | // Licence: wxWindows licence | |
10 | ///////////////////////////////////////////////////////////////////////////// | |
11 | ||
12 | #ifndef _WX_TOOLBAR_H_BASE_ | |
13 | #define _WX_TOOLBAR_H_BASE_ | |
14 | ||
f9dae779 VZ |
15 | #include "wx/defs.h" |
16 | ||
17 | // ---------------------------------------------------------------------------- | |
18 | // wxToolBar style flags | |
19 | // ---------------------------------------------------------------------------- | |
20 | ||
21 | enum | |
22 | { | |
23 | // lay out the toolbar horizontally | |
24 | wxTB_HORIZONTAL = wxHORIZONTAL, // == 0x0004 | |
25 | ||
26 | // lay out the toolbar vertically | |
27 | wxTB_VERTICAL = wxVERTICAL, // == 0x0008 | |
28 | ||
29 | // show 3D buttons (wxToolBarSimple only) | |
30 | wxTB_3DBUTTONS = 0x0010, | |
31 | ||
32 | // "flat" buttons (Win32/GTK only) | |
33 | wxTB_FLAT = 0x0020, | |
34 | ||
35 | // dockable toolbar (GTK only) | |
36 | wxTB_DOCKABLE = 0x0040, | |
37 | ||
38 | // don't show the icons (they're shown by default) | |
39 | wxTB_NOICONS = 0x0080, | |
40 | ||
41 | // show the text (not shown by default) | |
42 | wxTB_TEXT = 0x0100, | |
43 | ||
44 | // don't show the divider between toolbar and the window (Win32 only) | |
45 | wxTB_NODIVIDER = 0x0200, | |
46 | ||
47 | // no automatic alignment (Win32 only, useless) | |
48 | wxTB_NOALIGN = 0x0400, | |
49 | ||
50 | // show the text and the icons alongside, not vertically stacked (Win32/GTK) | |
51 | wxTB_HORZ_LAYOUT = 0x0800, | |
52 | wxTB_HORZ_TEXT = wxTB_HORZ_LAYOUT | wxTB_TEXT | |
53 | }; | |
6d167489 | 54 | |
8a0681f9 | 55 | #if wxUSE_TOOLBAR |
f9dae779 VZ |
56 | #include "wx/tbarbase.h" // the base class for all toolbars |
57 | ||
a9b33d6b | 58 | #if !wxUSE_TOOLBAR_NATIVE && !defined(__WXUNIVERSAL__) |
8a0681f9 | 59 | #include "wx/tbarsmpl.h" |
7aa58644 VZ |
60 | |
61 | class WXDLLEXPORT wxToolBar : public wxToolBarSimple | |
62 | { | |
63 | public: | |
64 | wxToolBar() { } | |
65 | ||
66 | wxToolBar(wxWindow *parent, | |
d9e2e4c2 | 67 | wxWindowID winid, |
7aa58644 VZ |
68 | const wxPoint& pos = wxDefaultPosition, |
69 | const wxSize& size = wxDefaultSize, | |
70 | long style = wxNO_BORDER | wxTB_HORIZONTAL, | |
71 | const wxString& name = wxToolBarNameStr) | |
d9e2e4c2 | 72 | : wxToolBarSimple(parent, winid, pos, size, style, name) { } |
7aa58644 | 73 | |
e88be8c9 | 74 | // the most commonly used version of AddTool() |
d9e2e4c2 | 75 | wxToolBarToolBase *AddTool(int toolid, |
e88be8c9 RR |
76 | const wxBitmap& bitmap, |
77 | const wxString& shortHelpString = wxEmptyString, | |
78 | const wxString& longHelpString = wxEmptyString) | |
79 | { | |
d9e2e4c2 | 80 | return wxToolBarSimple::AddTool(toolid, bitmap, wxNullBitmap, FALSE, -1, -1, NULL, |
e88be8c9 RR |
81 | shortHelpString, longHelpString); |
82 | } | |
a9b33d6b | 83 | |
e88be8c9 RR |
84 | // old form |
85 | wxToolBarToolBase *AddTool | |
86 | ( | |
d9e2e4c2 | 87 | int toolid, |
e88be8c9 RR |
88 | const wxBitmap& bitmap, |
89 | const wxBitmap& pushedBitmap, | |
90 | bool toggle, | |
91 | wxObject *clientData = NULL, | |
92 | const wxString& shortHelpString = wxEmptyString, | |
93 | const wxString& longHelpString = wxEmptyString | |
94 | ) | |
95 | { | |
d9e2e4c2 | 96 | return wxToolBarSimple::AddTool(toolid, bitmap, pushedBitmap, toggle, -1, -1, clientData, |
e88be8c9 RR |
97 | shortHelpString, longHelpString); |
98 | } | |
a9b33d6b | 99 | |
e88be8c9 RR |
100 | // virtual overridden |
101 | virtual wxToolBarToolBase *AddTool | |
102 | ( | |
d9e2e4c2 | 103 | int toolid, |
e88be8c9 RR |
104 | const wxBitmap& bitmap, |
105 | const wxBitmap& pushedBitmap, | |
106 | bool toggle, | |
107 | wxCoord xPos, | |
108 | wxCoord yPos = -1, | |
109 | wxObject *clientData = NULL, | |
110 | const wxString& shortHelpString = wxEmptyString, | |
111 | const wxString& longHelpString = wxEmptyString | |
112 | ) | |
113 | { | |
d9e2e4c2 | 114 | return wxToolBarSimple::AddTool(toolid, bitmap, pushedBitmap, toggle, xPos, yPos, clientData, |
e88be8c9 RR |
115 | shortHelpString, longHelpString); |
116 | } | |
a9b33d6b | 117 | |
7aa58644 VZ |
118 | private: |
119 | DECLARE_DYNAMIC_CLASS(wxToolBar) | |
120 | }; | |
8a0681f9 | 121 | #else // wxUSE_TOOLBAR_NATIVE |
c08a4f00 RR |
122 | #if defined(__WXUNIVERSAL__) |
123 | #include "wx/univ/toolbar.h" | |
39d2f9a7 JS |
124 | #elif defined(__WXWINCE__) |
125 | #include "wx/msw/wince/tbarwce.h" | |
c08a4f00 | 126 | #elif defined(__WXMSW__) && defined(__WIN95__) |
8a0681f9 VZ |
127 | #include "wx/msw/tbar95.h" |
128 | #elif defined(__WXMSW__) | |
129 | #include "wx/msw/tbarmsw.h" | |
130 | #elif defined(__WXMOTIF__) | |
131 | #include "wx/motif/toolbar.h" | |
132 | #elif defined(__WXGTK__) | |
133 | #include "wx/gtk/tbargtk.h" | |
8a0681f9 VZ |
134 | #elif defined(__WXMAC__) |
135 | #include "wx/mac/toolbar.h" | |
136 | #elif defined(__WXPM__) | |
137 | #include "wx/os2/toolbar.h" | |
8a0681f9 VZ |
138 | #endif |
139 | #endif // !wxUSE_TOOLBAR_NATIVE/wxUSE_TOOLBAR_NATIVE | |
140 | #endif // wxUSE_TOOLBAR | |
c801d85f KB |
141 | |
142 | #endif | |
6d167489 | 143 | // _WX_TOOLBAR_H_BASE_ |