]>
Commit | Line | Data |
---|---|---|
23324ae1 FM |
1 | ///////////////////////////////////////////////////////////////////////////// |
2 | // Name: toolbar.h | |
e54c96f1 | 3 | // Purpose: interface of wxToolBar |
23324ae1 FM |
4 | // Author: wxWidgets team |
5 | // RCS-ID: $Id$ | |
526954c5 | 6 | // Licence: wxWindows licence |
23324ae1 FM |
7 | ///////////////////////////////////////////////////////////////////////////// |
8 | ||
db51298a RD |
9 | enum wxToolBarToolStyle |
10 | { | |
11 | wxTOOL_STYLE_BUTTON = 1, | |
12 | wxTOOL_STYLE_SEPARATOR = 2, | |
13 | wxTOOL_STYLE_CONTROL | |
14 | }; | |
15 | ||
16 | ||
17 | /** wxToolBar style flags */ | |
18 | enum | |
19 | { | |
20 | /** lay out the toolbar horizontally */ | |
f75b1bd3 VZ |
21 | wxTB_HORIZONTAL = wxHORIZONTAL, |
22 | wxTB_TOP = wxTB_HORIZONTAL, | |
db51298a RD |
23 | |
24 | /** lay out the toolbar vertically */ | |
f75b1bd3 VZ |
25 | wxTB_VERTICAL = wxVERTICAL, |
26 | wxTB_LEFT = wxTB_VERTICAL, | |
db51298a RD |
27 | |
28 | /** show 3D buttons (wxToolBarSimple only) */ | |
29 | wxTB_3DBUTTONS, | |
30 | ||
31 | /** "flat" buttons (Win32/GTK only) */ | |
32 | wxTB_FLAT, | |
33 | ||
34 | /** dockable toolbar (GTK only) */ | |
35 | wxTB_DOCKABLE, | |
36 | ||
37 | /** don't show the icons (they're shown by default) */ | |
38 | wxTB_NOICONS, | |
39 | ||
40 | /** show the text (not shown by default) */ | |
41 | wxTB_TEXT, | |
42 | ||
43 | /** don't show the divider between toolbar and the window (Win32 only) */ | |
44 | wxTB_NODIVIDER, | |
45 | ||
46 | /** no automatic alignment (Win32 only, useless) */ | |
47 | wxTB_NOALIGN, | |
48 | ||
49 | /** show the text and the icons alongside, not vertically stacked (Win32/GTK) */ | |
50 | wxTB_HORZ_LAYOUT, | |
f75b1bd3 | 51 | wxTB_HORZ_TEXT = wxTB_HORZ_LAYOUT | wxTB_TEXT, |
db51298a RD |
52 | |
53 | /** don't show the toolbar short help tooltips */ | |
54 | wxTB_NO_TOOLTIPS, | |
55 | ||
56 | /** lay out toolbar at the bottom of the window */ | |
57 | wxTB_BOTTOM, | |
58 | ||
59 | /** lay out toolbar at the right edge of the window */ | |
f75b1bd3 VZ |
60 | wxTB_RIGHT, |
61 | ||
62 | /** flags that are closest to the native look*/ | |
63 | wxTB_DEFAULT_STYLE = wxTB_HORIZONTAL | wxTB_FLAT | |
db51298a RD |
64 | }; |
65 | ||
66 | ||
67 | ||
68 | /** | |
69 | @class wxToolBarToolBase | |
70 | ||
71 | A toolbar tool represents one item on the toolbar. | |
72 | ||
73 | It has a unique id (except for the separators), the style (telling whether | |
74 | it is a normal button, separator or a control), the state (toggled or not, | |
75 | enabled or not) and short and long help strings. The default | |
76 | implementations use the short help string for the tooltip text which is | |
77 | popped up when the mouse pointer enters the tool and the long help string | |
78 | for the applications status bar. | |
79 | */ | |
80 | class wxToolBarToolBase : public wxObject | |
81 | { | |
82 | public: | |
83 | wxToolBarToolBase(wxToolBarBase *tbar = NULL, | |
84 | int toolid = wxID_SEPARATOR, | |
85 | const wxString& label = wxEmptyString, | |
86 | const wxBitmap& bmpNormal = wxNullBitmap, | |
87 | const wxBitmap& bmpDisabled = wxNullBitmap, | |
88 | wxItemKind kind = wxITEM_NORMAL, | |
89 | wxObject *clientData = NULL, | |
90 | const wxString& shortHelpString = wxEmptyString, | |
91 | const wxString& longHelpString = wxEmptyString); | |
92 | ||
93 | wxToolBarToolBase(wxToolBarBase *tbar, | |
94 | wxControl *control, | |
95 | const wxString& label); | |
96 | ||
97 | virtual ~wxToolBarToolBase(); | |
98 | ||
99 | int GetId() const; | |
100 | ||
101 | wxControl *GetControl() const; | |
102 | wxToolBarBase *GetToolBar() const; | |
103 | ||
db51298a RD |
104 | bool IsStretchable() const; |
105 | bool IsButton() const; | |
106 | bool IsControl() const; | |
107 | bool IsSeparator() const; | |
108 | bool IsStretchableSpace() const; | |
109 | int GetStyle() const; | |
110 | wxItemKind GetKind() const; | |
111 | void MakeStretchable(); | |
112 | ||
db51298a RD |
113 | bool IsEnabled() const; |
114 | bool IsToggled() const; | |
115 | bool CanBeToggled() const; | |
116 | ||
db51298a RD |
117 | const wxBitmap& GetNormalBitmap() const; |
118 | const wxBitmap& GetDisabledBitmap() const; | |
119 | ||
120 | const wxBitmap& GetBitmap() const; | |
121 | const wxString& GetLabel() const; | |
122 | ||
123 | const wxString& GetShortHelp() const; | |
124 | const wxString& GetLongHelp() const; | |
125 | ||
126 | wxObject *GetClientData() const; | |
127 | ||
db51298a RD |
128 | virtual bool Enable(bool enable); |
129 | virtual bool Toggle(bool toggle); | |
130 | virtual bool SetToggle(bool toggle); | |
131 | virtual bool SetShortHelp(const wxString& help); | |
132 | virtual bool SetLongHelp(const wxString& help); | |
133 | void Toggle(); | |
134 | virtual void SetNormalBitmap(const wxBitmap& bmp); | |
135 | virtual void SetDisabledBitmap(const wxBitmap& bmp); | |
136 | virtual void SetLabel(const wxString& label); | |
137 | void SetClientData(wxObject *clientData); | |
138 | ||
db51298a RD |
139 | virtual void Detach(); |
140 | virtual void Attach(wxToolBarBase *tbar); | |
141 | ||
db51298a | 142 | virtual void SetDropdownMenu(wxMenu *menu); |
b23ea178 | 143 | wxMenu *GetDropdownMenu() const; |
db51298a RD |
144 | }; |
145 | ||
146 | ||
147 | ||
148 | ||
23324ae1 FM |
149 | /** |
150 | @class wxToolBar | |
7c913512 | 151 | |
bb69632a FM |
152 | A toolbar is a bar of buttons and/or other controls usually placed below |
153 | the menu bar in a wxFrame. | |
7977b62a | 154 | |
b1557978 | 155 | You may create a toolbar that is managed by a frame calling |
7977b62a BP |
156 | wxFrame::CreateToolBar(). Under Pocket PC, you should always use this |
157 | function for creating the toolbar to be managed by the frame, so that | |
158 | wxWidgets can use a combined menubar and toolbar. Where you manage your | |
b1557978 | 159 | own toolbars, create wxToolBar as usual. |
7977b62a | 160 | |
b1557978 FM |
161 | There are several different types of tools you can add to a toolbar. |
162 | These types are controlled by the ::wxItemKind enumeration. | |
163 | ||
164 | Note that many methods in wxToolBar such as wxToolBar::AddTool return a | |
165 | @c wxToolBarToolBase* object. | |
166 | This should be regarded as an opaque handle representing the newly added | |
167 | toolbar item, providing access to its id and position within the toolbar. | |
168 | Changes to the item's state should be made through calls to wxToolBar methods, | |
169 | for example wxToolBar::EnableTool. | |
170 | Calls to @c wxToolBarToolBase methods (undocumented by purpose) will not change | |
4c51a665 | 171 | the visible state of the item within the tool bar. |
7977b62a | 172 | |
bb69632a FM |
173 | <b>wxMSW note</b>: Note that under wxMSW toolbar paints tools to reflect |
174 | system-wide colours. If you use more than 16 colours in your tool bitmaps, | |
175 | you may wish to suppress this behaviour, otherwise system colours in your | |
176 | bitmaps will inadvertently be mapped to system colours. | |
7977b62a | 177 | To do this, set the msw.remap system option before creating the toolbar: |
7977b62a | 178 | @code |
f8ebb70d | 179 | wxSystemOptions::SetOption("msw.remap", 0); |
7977b62a | 180 | @endcode |
7977b62a BP |
181 | If you wish to use 32-bit images (which include an alpha channel for |
182 | transparency) use: | |
7977b62a | 183 | @code |
f8ebb70d | 184 | wxSystemOptions::SetOption("msw.remap", 2); |
7977b62a | 185 | @endcode |
7977b62a BP |
186 | Then colour remapping is switched off, and a transparent background |
187 | used. But only use this option under Windows XP with true colour: | |
7977b62a BP |
188 | @code |
189 | if (wxTheApp->GetComCtl32Version() >= 600 && ::wxDisplayDepth() >= 32) | |
190 | @endcode | |
408776d0 | 191 | |
23324ae1 | 192 | @beginStyleTable |
8c6791e4 | 193 | @style{wxTB_FLAT} |
7977b62a | 194 | Gives the toolbar a flat look (Windows and GTK only). |
8c6791e4 | 195 | @style{wxTB_DOCKABLE} |
7977b62a | 196 | Makes the toolbar floatable and dockable (GTK only). |
8c6791e4 | 197 | @style{wxTB_HORIZONTAL} |
7977b62a | 198 | Specifies horizontal layout (default). |
8c6791e4 | 199 | @style{wxTB_VERTICAL} |
7977b62a | 200 | Specifies vertical layout. |
8c6791e4 | 201 | @style{wxTB_TEXT} |
7977b62a | 202 | Shows the text in the toolbar buttons; by default only icons are shown. |
8c6791e4 | 203 | @style{wxTB_NOICONS} |
7977b62a | 204 | Specifies no icons in the toolbar buttons; by default they are shown. |
8c6791e4 | 205 | @style{wxTB_NODIVIDER} |
7977b62a | 206 | Specifies no divider (border) above the toolbar (Windows only) |
8c6791e4 | 207 | @style{wxTB_NOALIGN} |
7977b62a BP |
208 | Specifies no alignment with the parent window (Windows only, not very |
209 | useful). | |
8c6791e4 | 210 | @style{wxTB_HORZ_LAYOUT} |
7977b62a BP |
211 | Shows the text and the icons alongside, not vertically stacked (Windows |
212 | and GTK 2 only). This style must be used with @c wxTB_TEXT. | |
8c6791e4 | 213 | @style{wxTB_HORZ_TEXT} |
7977b62a | 214 | Combination of @c wxTB_HORZ_LAYOUT and @c wxTB_TEXT. |
8c6791e4 | 215 | @style{wxTB_NO_TOOLTIPS} |
7977b62a BP |
216 | Don't show the short help tooltips for the tools when the mouse hovers |
217 | over them. | |
8c6791e4 | 218 | @style{wxTB_BOTTOM} |
7977b62a | 219 | Align the toolbar at the bottom of parent window. |
8c6791e4 | 220 | @style{wxTB_RIGHT} |
7977b62a | 221 | Align the toolbar at the right side of parent window. |
f75b1bd3 VZ |
222 | @style{wxTB_DEFAULT_STYLE} |
223 | Combination of @c wxTB_HORIZONTAL and @c wxTB_FLAT. This style is new | |
224 | since wxWidgets 2.9.5. | |
23324ae1 | 225 | @endStyleTable |
7c913512 | 226 | |
b1557978 | 227 | See also @ref overview_windowstyles. Note that the wxMSW native toolbar |
7977b62a BP |
228 | ignores @c wxTB_NOICONS style. Also, toggling the @c wxTB_TEXT works only |
229 | if the style was initially on. | |
230 | ||
3051a44a | 231 | @beginEventEmissionTable{wxCommandEvent} |
7977b62a | 232 | @event{EVT_TOOL(id, func)} |
ce7fe42e VZ |
233 | Process a @c wxEVT_TOOL event (a synonym for @c |
234 | wxEVT_MENU). Pass the id of the tool. | |
7977b62a BP |
235 | @event{EVT_MENU(id, func)} |
236 | The same as EVT_TOOL(). | |
237 | @event{EVT_TOOL_RANGE(id1, id2, func)} | |
ce7fe42e | 238 | Process a @c wxEVT_TOOL event for a range of |
7977b62a BP |
239 | identifiers. Pass the ids of the tools. |
240 | @event{EVT_MENU_RANGE(id1, id2, func)} | |
241 | The same as EVT_TOOL_RANGE(). | |
242 | @event{EVT_TOOL_RCLICKED(id, func)} | |
ce7fe42e | 243 | Process a @c wxEVT_TOOL_RCLICKED event. Pass the id of the |
e431dd05 | 244 | tool. (Not available on wxOSX.) |
7977b62a | 245 | @event{EVT_TOOL_RCLICKED_RANGE(id1, id2, func)} |
ce7fe42e | 246 | Process a @c wxEVT_TOOL_RCLICKED event for a range of ids. Pass |
e431dd05 | 247 | the ids of the tools. (Not available on wxOSX.) |
7977b62a | 248 | @event{EVT_TOOL_ENTER(id, func)} |
ce7fe42e | 249 | Process a @c wxEVT_TOOL_ENTER event. Pass the id of the toolbar |
7977b62a | 250 | itself. The value of wxCommandEvent::GetSelection() is the tool id, or |
e431dd05 | 251 | -1 if the mouse cursor has moved off a tool. (Not available on wxOSX.) |
7977b62a | 252 | @event{EVT_TOOL_DROPDOWN(id, func)} |
ce7fe42e | 253 | Process a @c wxEVT_TOOL_DROPDOWN event. If unhandled, |
7977b62a BP |
254 | displays the default dropdown menu set using |
255 | wxToolBar::SetDropdownMenu(). | |
256 | @endEventTable | |
408776d0 | 257 | |
7977b62a BP |
258 | The toolbar class emits menu commands in the same way that a frame menubar |
259 | does, so you can use one EVT_MENU() macro for both a menu item and a toolbar | |
260 | button. The event handler functions take a wxCommandEvent argument. For most | |
261 | event macros, the identifier of the tool is passed, but for EVT_TOOL_ENTER() | |
262 | the toolbar window identifier is passed and the tool identifier is retrieved | |
b1557978 FM |
263 | from the wxCommandEvent. This is because the identifier may be @c wxID_ANY when the |
264 | mouse moves off a tool, and @c wxID_ANY is not allowed as an identifier in the event | |
7977b62a BP |
265 | system. |
266 | ||
267 | @library{wxcore} | |
23324ae1 | 268 | @category{miscwnd} |
7c913512 | 269 | |
f09b5681 | 270 | @see @ref overview_toolbar |
23324ae1 FM |
271 | */ |
272 | class wxToolBar : public wxControl | |
273 | { | |
274 | public: | |
7977b62a BP |
275 | /** |
276 | Default constructor. | |
277 | */ | |
278 | wxToolBar(); | |
279 | ||
23324ae1 FM |
280 | /** |
281 | Constructs a toolbar. | |
3c4f71cc | 282 | |
7c913512 | 283 | @param parent |
4cc4bfaf | 284 | Pointer to a parent window. |
7c913512 | 285 | @param id |
4cc4bfaf | 286 | Window identifier. If -1, will automatically create an identifier. |
7c913512 | 287 | @param pos |
b1557978 FM |
288 | Window position. ::wxDefaultPosition indicates that wxWidgets should |
289 | generate a default position for the window. | |
290 | If using the wxWindow class directly, supply an actual position. | |
7c913512 | 291 | @param size |
b1557978 FM |
292 | Window size. ::wxDefaultSize indicates that wxWidgets should generate |
293 | a default size for the window. | |
7c913512 | 294 | @param style |
b1557978 | 295 | Window style. See wxToolBar initial description for details. |
7c913512 | 296 | @param name |
4cc4bfaf | 297 | Window name. |
3c4f71cc | 298 | |
7977b62a | 299 | @remarks After a toolbar is created, you use AddTool() and perhaps |
b1557978 FM |
300 | AddSeparator(), and then you must call Realize() to construct |
301 | and display the toolbar tools. | |
23324ae1 | 302 | */ |
7c913512 FM |
303 | wxToolBar(wxWindow* parent, wxWindowID id, |
304 | const wxPoint& pos = wxDefaultPosition, | |
305 | const wxSize& size = wxDefaultSize, | |
ccf39540 | 306 | long style = wxTB_HORIZONTAL, |
408776d0 | 307 | const wxString& name = wxToolBarNameStr); |
23324ae1 FM |
308 | |
309 | /** | |
310 | Toolbar destructor. | |
311 | */ | |
adaaa686 | 312 | virtual ~wxToolBar(); |
23324ae1 FM |
313 | |
314 | /** | |
7977b62a BP |
315 | Adds a new check (or toggle) tool to the toolbar. The parameters are the |
316 | same as in AddTool(). | |
3c4f71cc | 317 | |
4cc4bfaf | 318 | @see AddTool() |
23324ae1 | 319 | */ |
43c48e1e | 320 | wxToolBarToolBase* AddCheckTool(int toolId, const wxString& label, |
23324ae1 | 321 | const wxBitmap& bitmap1, |
43c48e1e FM |
322 | const wxBitmap& bmpDisabled = wxNullBitmap, |
323 | const wxString& shortHelp = wxEmptyString, | |
324 | const wxString& longHelp = wxEmptyString, | |
4cc4bfaf | 325 | wxObject* clientData = NULL); |
23324ae1 FM |
326 | |
327 | /** | |
0824e369 | 328 | Adds any control to the toolbar, typically e.g.\ a wxComboBox. |
3c4f71cc | 329 | |
7c913512 | 330 | @param control |
4cc4bfaf | 331 | The control to be added. |
7c913512 | 332 | @param label |
4cc4bfaf | 333 | Text to be displayed near the control. |
3c4f71cc | 334 | |
7977b62a BP |
335 | @remarks |
336 | wxMSW: the label is only displayed if there is enough space | |
337 | available below the embedded control. | |
338 | ||
339 | @remarks | |
340 | wxMac: labels are only displayed if wxWidgets is built with @c | |
341 | wxMAC_USE_NATIVE_TOOLBAR set to 1 | |
23324ae1 | 342 | */ |
43c48e1e FM |
343 | virtual wxToolBarToolBase* AddControl(wxControl* control, |
344 | const wxString& label = wxEmptyString); | |
23324ae1 FM |
345 | |
346 | /** | |
7977b62a BP |
347 | Adds a new radio tool to the toolbar. Consecutive radio tools form a |
348 | radio group such that exactly one button in the group is pressed at any | |
349 | moment, in other words whenever a button in the group is pressed the | |
350 | previously pressed button is automatically released. You should avoid | |
351 | having the radio groups of only one element as it would be impossible | |
352 | for the user to use such button. | |
408776d0 | 353 | |
7977b62a BP |
354 | By default, the first button in the radio group is initially pressed, |
355 | the others are not. | |
356 | ||
3c4f71cc | 357 | |
4cc4bfaf | 358 | @see AddTool() |
23324ae1 | 359 | */ |
43c48e1e | 360 | wxToolBarToolBase* AddRadioTool(int toolId, const wxString& label, |
23324ae1 | 361 | const wxBitmap& bitmap1, |
43c48e1e FM |
362 | const wxBitmap& bmpDisabled = wxNullBitmap, |
363 | const wxString& shortHelp = wxEmptyString, | |
364 | const wxString& longHelp = wxEmptyString, | |
4cc4bfaf | 365 | wxObject* clientData = NULL); |
23324ae1 FM |
366 | |
367 | /** | |
368 | Adds a separator for spacing groups of tools. | |
3c4f71cc | 369 | |
8a9a313d VZ |
370 | Notice that the separator uses the look appropriate for the current |
371 | platform so it can be a vertical line (MSW, some versions of GTK) or | |
372 | just an empty space or something else. | |
b1557978 | 373 | |
cc260109 | 374 | @see AddTool(), SetToolSeparation(), AddStretchableSpace() |
23324ae1 | 375 | */ |
43c48e1e | 376 | virtual wxToolBarToolBase* AddSeparator(); |
23324ae1 | 377 | |
cc260109 VZ |
378 | /** |
379 | Adds a stretchable space to the toolbar. | |
380 | ||
381 | Any space not taken up by the fixed items (all items except for | |
382 | stretchable spaces) is distributed in equal measure between the | |
383 | stretchable spaces in the toolbar. The most common use for this method | |
384 | is to add a single stretchable space before the items which should be | |
385 | right-aligned in the toolbar, but more exotic possibilities are | |
386 | possible, e.g. a stretchable space may be added in the beginning and | |
387 | the end of the toolbar to centre all toolbar items. | |
388 | ||
389 | @see AddTool(), AddSeparator(), InsertStretchableSpace() | |
390 | ||
391 | @since 2.9.1 | |
392 | */ | |
393 | wxToolBarToolBase *AddStretchableSpace(); | |
394 | ||
8d13e301 | 395 | //@{ |
23324ae1 | 396 | /** |
922da38b BP |
397 | Adds a tool to the toolbar. |
398 | ||
399 | @param tool | |
400 | The tool to be added. | |
401 | ||
402 | @remarks After you have added tools to a toolbar, you must call | |
163bd4f7 | 403 | Realize() in order to have the tools appear. |
922da38b BP |
404 | |
405 | @see AddSeparator(), AddCheckTool(), AddRadioTool(), | |
406 | InsertTool(), DeleteTool(), Realize(), SetDropdownMenu() | |
407 | */ | |
adaaa686 | 408 | virtual wxToolBarToolBase* AddTool(wxToolBarToolBase* tool); |
922da38b BP |
409 | |
410 | /** | |
408776d0 | 411 | Adds a tool to the toolbar. This most commonly used version has fewer |
922da38b BP |
412 | parameters than the full version below which specifies the more rarely |
413 | used button features. | |
3c4f71cc | 414 | |
7c913512 | 415 | @param toolId |
7977b62a BP |
416 | An integer by which the tool may be identified in subsequent |
417 | operations. | |
408776d0 | 418 | @param label |
922da38b BP |
419 | The string to be displayed with the tool. |
420 | @param bitmap | |
421 | The primary tool bitmap. | |
422 | @param shortHelp | |
423 | This string is used for the tools tooltip. | |
7c913512 | 424 | @param kind |
7977b62a BP |
425 | May be ::wxITEM_NORMAL for a normal button (default), ::wxITEM_CHECK |
426 | for a checkable tool (such tool stays pressed after it had been | |
427 | toggled) or ::wxITEM_RADIO for a checkable tool which makes part of | |
408776d0 | 428 | a radio group of tools each of which is automatically unchecked |
970e987e RR |
429 | whenever another button in the group is checked. ::wxITEM_DROPDOWN |
430 | specifies that a drop-down menu button will appear next to the | |
431 | tool button (only GTK+ and MSW). Call SetDropdownMenu() afterwards. | |
922da38b BP |
432 | |
433 | @remarks After you have added tools to a toolbar, you must call | |
434 | Realize() in order to have the tools appear. | |
435 | ||
436 | @see AddSeparator(), AddCheckTool(), AddRadioTool(), | |
437 | InsertTool(), DeleteTool(), Realize(), SetDropdownMenu() | |
438 | */ | |
439 | wxToolBarToolBase* AddTool(int toolId, const wxString& label, | |
440 | const wxBitmap& bitmap, | |
441 | const wxString& shortHelp = wxEmptyString, | |
442 | wxItemKind kind = wxITEM_NORMAL); | |
443 | ||
444 | /** | |
445 | Adds a tool to the toolbar. | |
446 | ||
447 | @param toolId | |
448 | An integer by which the tool may be identified in subsequent | |
449 | operations. | |
408776d0 | 450 | @param label |
922da38b BP |
451 | The string to be displayed with the tool. |
452 | @param bitmap | |
4cc4bfaf | 453 | The primary tool bitmap. |
922da38b | 454 | @param bmpDisabled |
4cc4bfaf | 455 | The bitmap used when the tool is disabled. If it is equal to |
408776d0 | 456 | ::wxNullBitmap (default), the disabled bitmap is automatically |
922da38b | 457 | generated by greying the normal one. |
922da38b BP |
458 | @param kind |
459 | May be ::wxITEM_NORMAL for a normal button (default), ::wxITEM_CHECK | |
460 | for a checkable tool (such tool stays pressed after it had been | |
461 | toggled) or ::wxITEM_RADIO for a checkable tool which makes part of | |
408776d0 | 462 | a radio group of tools each of which is automatically unchecked |
922da38b BP |
463 | whenever another button in the group is checked. ::wxITEM_DROPDOWN |
464 | specifies that a drop-down menu button will appear next to the | |
465 | tool button (only GTK+ and MSW). Call SetDropdownMenu() afterwards. | |
001f1f56 FM |
466 | @param shortHelpString |
467 | This string is used for the tools tooltip. | |
468 | @param longHelpString | |
469 | This string is shown in the statusbar (if any) of the parent frame | |
470 | when the mouse pointer is inside the tool. | |
7c913512 | 471 | @param clientData |
7977b62a BP |
472 | An optional pointer to client data which can be retrieved later |
473 | using GetToolClientData(). | |
3c4f71cc | 474 | |
23324ae1 | 475 | @remarks After you have added tools to a toolbar, you must call |
7977b62a | 476 | Realize() in order to have the tools appear. |
3c4f71cc | 477 | |
4cc4bfaf | 478 | @see AddSeparator(), AddCheckTool(), AddRadioTool(), |
970e987e | 479 | InsertTool(), DeleteTool(), Realize(), SetDropdownMenu() |
23324ae1 FM |
480 | */ |
481 | wxToolBarToolBase* AddTool(int toolId, const wxString& label, | |
922da38b | 482 | const wxBitmap& bitmap, |
db51298a | 483 | const wxBitmap& bmpDisabled, |
7c913512 | 484 | wxItemKind kind = wxITEM_NORMAL, |
922da38b BP |
485 | const wxString& shortHelpString = wxEmptyString, |
486 | const wxString& longHelpString = wxEmptyString, | |
4cc4bfaf | 487 | wxObject* clientData = NULL); |
8d13e301 | 488 | //@} |
23324ae1 FM |
489 | |
490 | /** | |
491 | Deletes all the tools in the toolbar. | |
492 | */ | |
adaaa686 | 493 | virtual void ClearTools(); |
23324ae1 FM |
494 | |
495 | /** | |
7977b62a BP |
496 | Removes the specified tool from the toolbar and deletes it. If you don't |
497 | want to delete the tool, but just to remove it from the toolbar (to | |
498 | possibly add it back later), you may use RemoveTool() instead. | |
499 | ||
500 | @note It is unnecessary to call Realize() for the change to take | |
501 | place, it will happen immediately. | |
502 | ||
503 | @returns @true if the tool was deleted, @false otherwise. | |
3c4f71cc | 504 | |
4cc4bfaf | 505 | @see DeleteToolByPos() |
23324ae1 | 506 | */ |
adaaa686 | 507 | virtual bool DeleteTool(int toolId); |
23324ae1 FM |
508 | |
509 | /** | |
7977b62a BP |
510 | This function behaves like DeleteTool() but it deletes the tool at the |
511 | specified position and not the one with the given id. | |
23324ae1 | 512 | */ |
adaaa686 | 513 | virtual bool DeleteToolByPos(size_t pos); |
23324ae1 FM |
514 | |
515 | /** | |
516 | Enables or disables the tool. | |
3c4f71cc | 517 | |
7c913512 | 518 | @param toolId |
51c30bca | 519 | ID of the tool to enable or disable, as passed to AddTool(). |
7c913512 | 520 | @param enable |
4cc4bfaf | 521 | If @true, enables the tool, otherwise disables it. |
3c4f71cc | 522 | |
23324ae1 | 523 | @remarks Some implementations will change the visible state of the tool |
7977b62a BP |
524 | to indicate that it is disabled. |
525 | ||
3c4f71cc | 526 | |
4cc4bfaf | 527 | @see GetToolEnabled(), ToggleTool() |
23324ae1 | 528 | */ |
adaaa686 | 529 | virtual void EnableTool(int toolId, bool enable); |
23324ae1 FM |
530 | |
531 | /** | |
7977b62a BP |
532 | Returns a pointer to the tool identified by @a id or @NULL if no |
533 | corresponding tool is found. | |
23324ae1 | 534 | */ |
adaaa686 | 535 | wxToolBarToolBase* FindById(int id) const; |
23324ae1 FM |
536 | |
537 | /** | |
7977b62a BP |
538 | Returns a pointer to the control identified by @a id or @NULL if no |
539 | corresponding control is found. | |
23324ae1 | 540 | */ |
adaaa686 | 541 | virtual wxControl* FindControl(int id); |
23324ae1 FM |
542 | |
543 | /** | |
544 | Finds a tool for the given mouse position. | |
3c4f71cc | 545 | |
7c913512 | 546 | @param x |
4cc4bfaf | 547 | X position. |
7c913512 | 548 | @param y |
4cc4bfaf | 549 | Y position. |
3c4f71cc | 550 | |
d29a9a8a | 551 | @return A pointer to a tool if a tool is found, or @NULL otherwise. |
3c4f71cc | 552 | |
7977b62a BP |
553 | @remarks Currently not implemented in wxGTK (always returns @NULL |
554 | there). | |
23324ae1 | 555 | */ |
adaaa686 | 556 | virtual wxToolBarToolBase* FindToolForPosition(wxCoord x, wxCoord y) const; |
23324ae1 FM |
557 | |
558 | /** | |
559 | Returns the left/right and top/bottom margins, which are also used for | |
560 | inter-toolspacing. | |
3c4f71cc | 561 | |
4cc4bfaf | 562 | @see SetMargins() |
23324ae1 | 563 | */ |
328f5751 | 564 | wxSize GetMargins() const; |
23324ae1 FM |
565 | |
566 | /** | |
040d3c2e VZ |
567 | Returns the size of bitmap that the toolbar expects to have. |
568 | ||
569 | The default bitmap size is platform-dependent: for example, it is 16*15 | |
570 | for MSW and 24*24 for GTK. This size does @em not necessarily indicate | |
571 | the best size to use for the toolbars on the given platform, for this | |
572 | you should use @c wxArtProvider::GetNativeSizeHint(wxART_TOOLBAR) but | |
573 | in any case, as the bitmap size is deduced automatically from the size | |
574 | of the bitmaps associated with the tools added to the toolbar, it is | |
575 | usually unnecessary to call SetToolBitmapSize() explicitly. | |
3c4f71cc | 576 | |
7977b62a BP |
577 | @remarks Note that this is the size of the bitmap you pass to AddTool(), |
578 | and not the eventual size of the tool button. | |
3c4f71cc | 579 | |
4cc4bfaf | 580 | @see SetToolBitmapSize(), GetToolSize() |
23324ae1 | 581 | */ |
adaaa686 | 582 | virtual wxSize GetToolBitmapSize() const; |
23324ae1 | 583 | |
e79f02bd VZ |
584 | /** |
585 | Returns a pointer to the tool at ordinal position @a pos. | |
586 | ||
587 | Don't confuse this with FindToolForPosition(). | |
588 | ||
589 | @since 2.9.1 | |
590 | ||
591 | @see GetToolsCount() | |
592 | */ | |
593 | const wxToolBarToolBase *GetToolByPos(int pos) const; | |
594 | ||
23324ae1 FM |
595 | /** |
596 | Get any client data associated with the tool. | |
3c4f71cc | 597 | |
7c913512 | 598 | @param toolId |
51c30bca | 599 | ID of the tool in question, as passed to AddTool(). |
3c4f71cc | 600 | |
d29a9a8a | 601 | @return Client data, or @NULL if there is none. |
23324ae1 | 602 | */ |
adaaa686 | 603 | virtual wxObject* GetToolClientData(int toolId) const; |
23324ae1 FM |
604 | |
605 | /** | |
606 | Called to determine whether a tool is enabled (responds to user input). | |
3c4f71cc | 607 | |
7c913512 | 608 | @param toolId |
51c30bca | 609 | ID of the tool in question, as passed to AddTool(). |
3c4f71cc | 610 | |
d29a9a8a | 611 | @return @true if the tool is enabled, @false otherwise. |
3c4f71cc | 612 | |
4cc4bfaf | 613 | @see EnableTool() |
23324ae1 | 614 | */ |
adaaa686 | 615 | virtual bool GetToolEnabled(int toolId) const; |
23324ae1 FM |
616 | |
617 | /** | |
618 | Returns the long help for the given tool. | |
3c4f71cc | 619 | |
7c913512 | 620 | @param toolId |
51c30bca | 621 | ID of the tool in question, as passed to AddTool(). |
3c4f71cc | 622 | |
4cc4bfaf | 623 | @see SetToolLongHelp(), SetToolShortHelp() |
23324ae1 | 624 | */ |
adaaa686 | 625 | virtual wxString GetToolLongHelp(int toolId) const; |
23324ae1 FM |
626 | |
627 | /** | |
628 | Returns the value used for packing tools. | |
3c4f71cc | 629 | |
4cc4bfaf | 630 | @see SetToolPacking() |
23324ae1 | 631 | */ |
adaaa686 | 632 | virtual int GetToolPacking() const; |
23324ae1 FM |
633 | |
634 | /** | |
7977b62a BP |
635 | Returns the tool position in the toolbar, or @c wxNOT_FOUND if the tool |
636 | is not found. | |
51c30bca VZ |
637 | |
638 | @param toolId | |
639 | ID of the tool in question, as passed to AddTool(). | |
23324ae1 | 640 | */ |
adaaa686 | 641 | virtual int GetToolPos(int toolId) const; |
23324ae1 FM |
642 | |
643 | /** | |
644 | Returns the default separator size. | |
3c4f71cc | 645 | |
4cc4bfaf | 646 | @see SetToolSeparation() |
23324ae1 | 647 | */ |
adaaa686 | 648 | virtual int GetToolSeparation() const; |
23324ae1 FM |
649 | |
650 | /** | |
651 | Returns the short help for the given tool. | |
3c4f71cc | 652 | |
7c913512 | 653 | @param toolId |
51c30bca | 654 | ID of the tool in question, as passed to AddTool(). |
3c4f71cc | 655 | |
4cc4bfaf | 656 | @see GetToolLongHelp(), SetToolShortHelp() |
23324ae1 | 657 | */ |
adaaa686 | 658 | virtual wxString GetToolShortHelp(int toolId) const; |
23324ae1 FM |
659 | |
660 | /** | |
7977b62a BP |
661 | Returns the size of a whole button, which is usually larger than a tool |
662 | bitmap because of added 3D effects. | |
3c4f71cc | 663 | |
4cc4bfaf | 664 | @see SetToolBitmapSize(), GetToolBitmapSize() |
23324ae1 | 665 | */ |
adaaa686 | 666 | virtual wxSize GetToolSize() const; |
23324ae1 FM |
667 | |
668 | /** | |
669 | Gets the on/off state of a toggle tool. | |
3c4f71cc | 670 | |
7c913512 | 671 | @param toolId |
51c30bca | 672 | ID of the tool in question, as passed to AddTool(). |
3c4f71cc | 673 | |
d29a9a8a | 674 | @return @true if the tool is toggled on, @false otherwise. |
3c4f71cc | 675 | |
4cc4bfaf | 676 | @see ToggleTool() |
23324ae1 | 677 | */ |
adaaa686 | 678 | virtual bool GetToolState(int toolId) const; |
23324ae1 FM |
679 | |
680 | /** | |
681 | Returns the number of tools in the toolbar. | |
682 | */ | |
43c48e1e | 683 | size_t GetToolsCount() const; |
23324ae1 FM |
684 | |
685 | /** | |
7977b62a BP |
686 | Inserts the control into the toolbar at the given position. You must |
687 | call Realize() for the change to take place. | |
3c4f71cc | 688 | |
4cc4bfaf | 689 | @see AddControl(), InsertTool() |
23324ae1 | 690 | */ |
43c48e1e FM |
691 | virtual wxToolBarToolBase* InsertControl(size_t pos, wxControl* control, |
692 | const wxString& label = wxEmptyString); | |
23324ae1 FM |
693 | |
694 | /** | |
7977b62a BP |
695 | Inserts the separator into the toolbar at the given position. You must |
696 | call Realize() for the change to take place. | |
3c4f71cc | 697 | |
4cc4bfaf | 698 | @see AddSeparator(), InsertTool() |
23324ae1 | 699 | */ |
adaaa686 | 700 | virtual wxToolBarToolBase* InsertSeparator(size_t pos); |
23324ae1 | 701 | |
cc260109 VZ |
702 | /** |
703 | Inserts a stretchable space at the given position. | |
704 | ||
705 | See AddStretchableSpace() for details about stretchable spaces. | |
706 | ||
707 | @see InsertTool(), InsertSeparator() | |
708 | ||
709 | @since 2.9.1 | |
710 | */ | |
711 | wxToolBarToolBase *InsertStretchableSpace(size_t pos); | |
712 | ||
23324ae1 FM |
713 | //@{ |
714 | /** | |
7977b62a BP |
715 | Inserts the tool with the specified attributes into the toolbar at the |
716 | given position. | |
717 | ||
23324ae1 | 718 | You must call Realize() for the change to take place. |
3c4f71cc | 719 | |
4cc4bfaf | 720 | @see AddTool(), InsertControl(), InsertSeparator() |
26007761 VZ |
721 | |
722 | @return The newly inserted tool or @NULL on failure. Notice that with | |
723 | the overload taking @a tool parameter the caller is responsible for | |
724 | deleting the tool in the latter case. | |
4cc4bfaf | 725 | */ |
b23ea178 RD |
726 | wxToolBarToolBase* InsertTool( size_t pos, |
727 | int toolId, | |
728 | const wxString& label, | |
729 | const wxBitmap& bitmap, | |
730 | const wxBitmap& bmpDisabled = wxNullBitmap, | |
731 | wxItemKind kind = wxITEM_NORMAL, | |
732 | const wxString& shortHelp = wxEmptyString, | |
733 | const wxString& longHelp = wxEmptyString, | |
734 | wxObject *clientData = NULL); | |
735 | ||
4cc4bfaf FM |
736 | wxToolBarToolBase* InsertTool(size_t pos, |
737 | wxToolBarToolBase* tool); | |
23324ae1 FM |
738 | //@} |
739 | ||
740 | /** | |
7977b62a BP |
741 | Called when the user clicks on a tool with the left mouse button. This |
742 | is the old way of detecting tool clicks; although it will still work, | |
743 | you should use the EVT_MENU() or EVT_TOOL() macro instead. | |
3c4f71cc | 744 | |
7c913512 | 745 | @param toolId |
4cc4bfaf | 746 | The identifier passed to AddTool(). |
7c913512 | 747 | @param toggleDown |
7977b62a BP |
748 | @true if the tool is a toggle and the toggle is down, otherwise is |
749 | @false. | |
3c4f71cc | 750 | |
d29a9a8a | 751 | @return If the tool is a toggle and this function returns @false, the |
7977b62a BP |
752 | toggle state (internal and visual) will not be changed. This |
753 | provides a way of specifying that toggle operations are not | |
754 | permitted in some circumstances. | |
3c4f71cc | 755 | |
4cc4bfaf | 756 | @see OnMouseEnter(), OnRightClick() |
23324ae1 | 757 | */ |
adaaa686 | 758 | virtual bool OnLeftClick(int toolId, bool toggleDown); |
23324ae1 FM |
759 | |
760 | /** | |
7977b62a BP |
761 | This is called when the mouse cursor moves into a tool or out of the |
762 | toolbar. This is the old way of detecting mouse enter events; | |
763 | although it will still work, you should use the EVT_TOOL_ENTER() | |
764 | macro instead. | |
3c4f71cc | 765 | |
7c913512 | 766 | @param toolId |
7977b62a BP |
767 | Greater than -1 if the mouse cursor has moved into the tool, or -1 |
768 | if the mouse cursor has moved. The programmer can override this to | |
769 | provide extra information about the tool, such as a short | |
770 | description on the status line. | |
3c4f71cc | 771 | |
23324ae1 | 772 | @remarks With some derived toolbar classes, if the mouse moves quickly |
7977b62a BP |
773 | out of the toolbar, wxWidgets may not be able to detect it. |
774 | Therefore this function may not always be called when expected. | |
23324ae1 | 775 | */ |
adaaa686 | 776 | virtual void OnMouseEnter(int toolId); |
23324ae1 FM |
777 | |
778 | /** | |
7977b62a BP |
779 | @deprecated This is the old way of detecting tool right clicks; |
780 | although it will still work, you should use the | |
781 | EVT_TOOL_RCLICKED() macro instead. | |
782 | ||
23324ae1 FM |
783 | Called when the user clicks on a tool with the right mouse button. The |
784 | programmer should override this function to detect right tool clicks. | |
3c4f71cc | 785 | |
7c913512 | 786 | @param toolId |
4cc4bfaf | 787 | The identifier passed to AddTool(). |
7c913512 | 788 | @param x |
4cc4bfaf | 789 | The x position of the mouse cursor. |
7c913512 | 790 | @param y |
4cc4bfaf | 791 | The y position of the mouse cursor. |
3c4f71cc | 792 | |
23324ae1 | 793 | @remarks A typical use of this member might be to pop up a menu. |
3c4f71cc | 794 | |
4cc4bfaf | 795 | @see OnMouseEnter(), OnLeftClick() |
23324ae1 | 796 | */ |
43c48e1e | 797 | virtual void OnRightClick(int toolId, long x, long y); |
23324ae1 FM |
798 | |
799 | /** | |
800 | This function should be called after you have added tools. | |
801 | */ | |
adaaa686 | 802 | virtual bool Realize(); |
23324ae1 FM |
803 | |
804 | /** | |
7977b62a BP |
805 | Removes the given tool from the toolbar but doesn't delete it. This |
806 | allows to insert/add this tool back to this (or another) toolbar later. | |
807 | ||
808 | @note It is unnecessary to call Realize() for the change to take place, | |
809 | it will happen immediately. | |
810 | ||
3c4f71cc | 811 | |
4cc4bfaf | 812 | @see DeleteTool() |
23324ae1 | 813 | */ |
adaaa686 | 814 | virtual wxToolBarToolBase* RemoveTool(int id); |
23324ae1 FM |
815 | |
816 | /** | |
7977b62a | 817 | Sets the bitmap resource identifier for specifying tool bitmaps as |
184abb52 VZ |
818 | indices into a custom bitmap. |
819 | ||
820 | This is a Windows CE-specific method not available in the other ports. | |
821 | ||
83189c3b | 822 | @onlyfor{wxmsw_wince} |
23324ae1 FM |
823 | */ |
824 | void SetBitmapResource(int resourceId); | |
825 | ||
826 | /** | |
7977b62a | 827 | Sets the dropdown menu for the tool given by its @e id. The tool itself |
970e987e RR |
828 | will delete the menu when it's no longer needed. Only supported under |
829 | GTK+ und MSW. | |
7977b62a BP |
830 | |
831 | If you define a EVT_TOOL_DROPDOWN() handler in your program, you must | |
832 | call wxEvent::Skip() from it or the menu won't be displayed. | |
23324ae1 FM |
833 | */ |
834 | bool SetDropdownMenu(int id, wxMenu* menu); | |
835 | ||
8d13e301 | 836 | //@{ |
23324ae1 FM |
837 | /** |
838 | Set the values to be used as margins for the toolbar. | |
3c4f71cc | 839 | |
7c913512 | 840 | @param x |
4cc4bfaf | 841 | Left margin, right margin and inter-tool separation value. |
7c913512 | 842 | @param y |
4cc4bfaf | 843 | Top margin, bottom margin and inter-tool separation value. |
3c4f71cc | 844 | |
23324ae1 | 845 | @remarks This must be called before the tools are added if absolute |
7977b62a BP |
846 | positioning is to be used, and the default (zero-size) margins are |
847 | to be overridden. | |
3c4f71cc | 848 | |
922da38b BP |
849 | @see GetMargins() |
850 | */ | |
adaaa686 | 851 | virtual void SetMargins(int x, int y); |
922da38b BP |
852 | |
853 | /** | |
854 | Set the margins for the toolbar. | |
855 | ||
856 | @param size | |
857 | Margin size. | |
858 | ||
859 | @remarks This must be called before the tools are added if absolute | |
860 | positioning is to be used, and the default (zero-size) margins are | |
861 | to be overridden. | |
862 | ||
4cc4bfaf | 863 | @see GetMargins(), wxSize |
23324ae1 FM |
864 | */ |
865 | void SetMargins(const wxSize& size); | |
8d13e301 | 866 | //@} |
23324ae1 FM |
867 | |
868 | /** | |
7977b62a BP |
869 | Sets the default size of each tool bitmap. The default bitmap size is 16 |
870 | by 15 pixels. | |
3c4f71cc | 871 | |
7c913512 | 872 | @param size |
4cc4bfaf | 873 | The size of the bitmaps in the toolbar. |
3c4f71cc | 874 | |
23324ae1 | 875 | @remarks This should be called to tell the toolbar what the tool bitmap |
7977b62a | 876 | size is. Call it before you add tools. |
3c4f71cc | 877 | |
4cc4bfaf | 878 | @see GetToolBitmapSize(), GetToolSize() |
23324ae1 | 879 | */ |
adaaa686 | 880 | virtual void SetToolBitmapSize(const wxSize& size); |
23324ae1 FM |
881 | |
882 | /** | |
883 | Sets the client data associated with the tool. | |
51c30bca VZ |
884 | |
885 | @param id | |
886 | ID of the tool in question, as passed to AddTool(). | |
23324ae1 | 887 | */ |
adaaa686 | 888 | virtual void SetToolClientData(int id, wxObject* clientData); |
23324ae1 FM |
889 | |
890 | /** | |
891 | Sets the bitmap to be used by the tool with the given ID when the tool | |
7977b62a BP |
892 | is in a disabled state. This can only be used on Button tools, not |
893 | controls. | |
894 | ||
51c30bca VZ |
895 | @param id |
896 | ID of the tool in question, as passed to AddTool(). | |
897 | ||
7977b62a BP |
898 | @note The native toolbar classes on the main platforms all synthesize |
899 | the disabled bitmap from the normal bitmap, so this function will | |
900 | have no effect on those platforms. | |
901 | ||
23324ae1 | 902 | */ |
adaaa686 | 903 | virtual void SetToolDisabledBitmap(int id, const wxBitmap& bitmap); |
23324ae1 FM |
904 | |
905 | /** | |
906 | Sets the long help for the given tool. | |
3c4f71cc | 907 | |
7c913512 | 908 | @param toolId |
51c30bca | 909 | ID of the tool in question, as passed to AddTool(). |
7c913512 | 910 | @param helpString |
4cc4bfaf | 911 | A string for the long help. |
3c4f71cc | 912 | |
23324ae1 | 913 | @remarks You might use the long help for displaying the tool purpose on |
7977b62a | 914 | the status line. |
3c4f71cc | 915 | |
4cc4bfaf | 916 | @see GetToolLongHelp(), SetToolShortHelp(), |
23324ae1 | 917 | */ |
adaaa686 | 918 | virtual void SetToolLongHelp(int toolId, const wxString& helpString); |
23324ae1 FM |
919 | |
920 | /** | |
7977b62a BP |
921 | Sets the bitmap to be used by the tool with the given ID. This can only |
922 | be used on Button tools, not controls. | |
51c30bca VZ |
923 | |
924 | @param id | |
925 | ID of the tool in question, as passed to AddTool(). | |
23324ae1 | 926 | */ |
adaaa686 | 927 | virtual void SetToolNormalBitmap(int id, const wxBitmap& bitmap); |
23324ae1 FM |
928 | |
929 | /** | |
930 | Sets the value used for spacing tools. The default value is 1. | |
3c4f71cc | 931 | |
7c913512 | 932 | @param packing |
4cc4bfaf | 933 | The value for packing. |
3c4f71cc | 934 | |
408776d0 | 935 | @remarks The packing is used for spacing in the vertical direction if |
7977b62a BP |
936 | the toolbar is horizontal, and for spacing in the horizontal |
937 | direction if the toolbar is vertical. | |
3c4f71cc | 938 | |
4cc4bfaf | 939 | @see GetToolPacking() |
23324ae1 | 940 | */ |
adaaa686 | 941 | virtual void SetToolPacking(int packing); |
23324ae1 FM |
942 | |
943 | /** | |
944 | Sets the default separator size. The default value is 5. | |
3c4f71cc | 945 | |
7c913512 | 946 | @param separation |
4cc4bfaf | 947 | The separator size. |
3c4f71cc | 948 | |
4cc4bfaf | 949 | @see AddSeparator() |
23324ae1 | 950 | */ |
adaaa686 | 951 | virtual void SetToolSeparation(int separation); |
23324ae1 FM |
952 | |
953 | /** | |
954 | Sets the short help for the given tool. | |
3c4f71cc | 955 | |
7c913512 | 956 | @param toolId |
51c30bca | 957 | ID of the tool in question, as passed to AddTool(). |
7c913512 | 958 | @param helpString |
4cc4bfaf | 959 | The string for the short help. |
3c4f71cc | 960 | |
23324ae1 | 961 | @remarks An application might use short help for identifying the tool |
7977b62a BP |
962 | purpose in a tooltip. |
963 | ||
3c4f71cc | 964 | |
4cc4bfaf | 965 | @see GetToolShortHelp(), SetToolLongHelp() |
23324ae1 | 966 | */ |
adaaa686 | 967 | virtual void SetToolShortHelp(int toolId, const wxString& helpString); |
23324ae1 FM |
968 | |
969 | /** | |
970 | Toggles a tool on or off. This does not cause any event to get emitted. | |
3c4f71cc | 971 | |
7c913512 | 972 | @param toolId |
51c30bca | 973 | ID of the tool in question, as passed to AddTool(). |
7c913512 | 974 | @param toggle |
4cc4bfaf | 975 | If @true, toggles the tool on, otherwise toggles it off. |
3c4f71cc | 976 | |
7977b62a BP |
977 | @remarks Only applies to a tool that has been specified as a toggle |
978 | tool. | |
23324ae1 | 979 | */ |
adaaa686 | 980 | virtual void ToggleTool(int toolId, bool toggle); |
f2b6dd8c RD |
981 | |
982 | ||
983 | /** | |
984 | Factory function to create a new toolbar tool. | |
985 | */ | |
b23ea178 | 986 | virtual wxToolBarToolBase *CreateTool(int toolId, |
f2b6dd8c RD |
987 | const wxString& label, |
988 | const wxBitmap& bmpNormal, | |
989 | const wxBitmap& bmpDisabled = wxNullBitmap, | |
990 | wxItemKind kind = wxITEM_NORMAL, | |
991 | wxObject *clientData = NULL, | |
992 | const wxString& shortHelp = wxEmptyString, | |
993 | const wxString& longHelp = wxEmptyString); | |
994 | /** | |
995 | Factory function to create a new control toolbar tool. | |
996 | */ | |
997 | virtual wxToolBarToolBase *CreateTool(wxControl *control, | |
998 | const wxString& label); | |
999 | ||
1000 | /** | |
1001 | Factory function to create a new separator toolbar tool. | |
1002 | */ | |
1003 | wxToolBarToolBase *CreateSeparator() | |
23324ae1 | 1004 | }; |
e54c96f1 | 1005 |