]> git.saurik.com Git - wxWidgets.git/blob - include/wx/toolbar.h
c2ba87c44a33d9cb846e131a987077a5662bde39
[wxWidgets.git] / include / wx / toolbar.h
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
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 };
54
55 #if wxUSE_TOOLBAR
56 #include "wx/tbarbase.h" // the base class for all toolbars
57
58 #if !wxUSE_TOOLBAR_NATIVE && !defined(__WXUNIVERSAL__)
59 #include "wx/tbarsmpl.h"
60
61 class WXDLLEXPORT wxToolBar : public wxToolBarSimple
62 {
63 public:
64 wxToolBar() { }
65
66 wxToolBar(wxWindow *parent,
67 wxWindowID winid,
68 const wxPoint& pos = wxDefaultPosition,
69 const wxSize& size = wxDefaultSize,
70 long style = wxNO_BORDER | wxTB_HORIZONTAL,
71 const wxString& name = wxToolBarNameStr)
72 : wxToolBarSimple(parent, winid, pos, size, style, name) { }
73
74 // the most commonly used version of AddTool()
75 wxToolBarToolBase *AddTool(int toolid,
76 const wxBitmap& bitmap,
77 const wxString& shortHelpString = wxEmptyString,
78 const wxString& longHelpString = wxEmptyString)
79 {
80 return wxToolBarSimple::AddTool(toolid, bitmap, wxNullBitmap, FALSE, -1, -1, NULL,
81 shortHelpString, longHelpString);
82 }
83
84 // old form
85 wxToolBarToolBase *AddTool
86 (
87 int toolid,
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 {
96 return wxToolBarSimple::AddTool(toolid, bitmap, pushedBitmap, toggle, -1, -1, clientData,
97 shortHelpString, longHelpString);
98 }
99
100 // virtual overridden
101 virtual wxToolBarToolBase *AddTool
102 (
103 int toolid,
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 {
114 return wxToolBarSimple::AddTool(toolid, bitmap, pushedBitmap, toggle, xPos, yPos, clientData,
115 shortHelpString, longHelpString);
116 }
117
118 private:
119 DECLARE_DYNAMIC_CLASS(wxToolBar)
120 };
121 #else // wxUSE_TOOLBAR_NATIVE
122 #if defined(__WXUNIVERSAL__)
123 #include "wx/univ/toolbar.h"
124 #elif defined(__WXWINCE__)
125 #include "wx/msw/wince/tbarwce.h"
126 #elif defined(__WXMSW__) && defined(__WIN95__)
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"
134 #elif defined(__WXMAC__)
135 #include "wx/mac/toolbar.h"
136 #elif defined(__WXPM__)
137 #include "wx/os2/toolbar.h"
138 #endif
139 #endif // !wxUSE_TOOLBAR_NATIVE/wxUSE_TOOLBAR_NATIVE
140 #endif // wxUSE_TOOLBAR
141
142 #endif
143 // _WX_TOOLBAR_H_BASE_