]> git.saurik.com Git - wxWidgets.git/blob - docs/latex/wx/toolbar.tex
added wxEncodingConverter
[wxWidgets.git] / docs / latex / wx / toolbar.tex
1 \section{\class{wxToolBar}}\label{wxtoolbar}
2
3 The name wxToolBar is defined to be a synonym for one of the following classes:
4
5 \begin{itemize}\itemsep=0pt
6 \item {\bf wxToolBar95} The native Windows 95 toolbar. Used on Windows 95, NT 4 and above.
7 \item {\bf wxToolBarMSW} A Windows implementation. Used on 16-bit Windows.
8 \item {\bf wxToolBarGTK} The GTK toolbar.
9 \item {\bf wxToolBarSimple} A simple implementation, with scrolling.
10 Used on platforms with no native toolbar control, or where scrolling is required.
11 \end{itemize}
12
13 Note that the base class {\bf wxToolBarBase} defines
14 automatic scrolling management functionality which is similar
15 to \helpref{wxScrolledWindow}{wxscrolledwindow}, so please refer to this class also.
16 Not all toolbars support scrolling, but wxToolBarSimple does.
17
18 \wxheading{Derived from}
19
20 wxToolBarBase\\
21 \helpref{wxControl}{wxcontrol}\\
22 \helpref{wxWindow}{wxwindow}\\
23 \helpref{wxEvtHandler}{wxevthandler}\\
24 \helpref{wxObject}{wxobject}
25
26 \wxheading{Include files}
27
28 <wx/toolbar.h> (to allow wxWindows to select an appropriate toolbar class)\\
29 <wx/tbarbase.h> (the base class)\\
30 <wx/tbarmsw.h> (the non-Windows 95 Windows toolbar class)\\
31 <wx/tbar95.h> (the Windows 95/98 toolbar class)\\
32 <wx/tbarsmpl.h> (the generic simple toolbar class)
33
34 \wxheading{Remarks}
35
36 You may also create a toolbar that is managed by the frame, by
37 calling \helpref{wxFrame::CreateToolBar}{wxframecreatetoolbar}.
38
39 Due to the use of native toolbars on the various platforms, certain adaptions will
40 often have to be made in order to get optimal look on all platforms as some platforms
41 ignore the values for explicit placement and use their own layout and the meaning
42 of a "separator" is a vertical line under Windows95 vs. simple space under GTK etc.
43
44 {\bf wxToolBar95:} Note that this toolbar paints tools to reflect user-selected colours.
45 The toolbar orientation must always be {\bf wxHORIZONTAL}.
46
47 {\bf wxToolBarGtk:} The toolbar orientation is ignored and is always {\bf wxHORIZONTAL}.
48
49 \wxheading{Window styles}
50
51 \twocolwidtha{5cm}
52 \begin{twocollist}\itemsep=0pt
53 \twocolitem{\windowstyle{wxTB\_FLAT}}{Gives the toolbar a flat look ('coolbar' or 'flatbar' style). Windows 95 and GTK 1.2 only.}
54 \twocolitem{\windowstyle{wxTB\_DOCKABLE}}{Makes the toolbar floatable and dockable. GTK only.}
55 \twocolitem{\windowstyle{wxTB\_HORIZONTAL}}{Specifies horizontal layout.}
56 \twocolitem{\windowstyle{wxTB\_VERTICAL}}{Specifies vertical layout (not available for the GTK and Windows 95
57 toolbar).}
58 \twocolitem{\windowstyle{wxTB\_3DBUTTONS}}{Gives wxToolBarSimple a mild 3D look to its buttons.}
59 \end{twocollist}
60
61 See also \helpref{window styles overview}{windowstyles}.
62
63 \wxheading{Event handling}
64
65 The toolbar class emits menu commands in the same was that a frame menubar does,
66 so you can use one EVT\_MENU macro for both a menu item and a toolbar button.
67 The event handler functions take a wxCommandEvent argument. For most event macros,
68 the identifier of the tool is passed, but for EVT\_TOOL\_ENTER the toolbar
69 window is passed and the tool id is retrieved from the wxCommandEvent.
70 This is because the id may be -1 when the mouse moves off a tool, and -1 is not
71 allowed as an identifier in the event system.
72
73 Note that tool commands (and UI update events for tools) are first sent to
74 the focus window within the frame that contains the toolbar. If no window within the frame has the focus,
75 then the events are sent directly to the toolbar (and up the hierarchy to the
76 frame, depending on where the application has put its event handlers). This allows command and UI update
77 handling to be processed by specific windows and controls, and not necessarily
78 by the application frame.
79
80 \twocolwidtha{7cm}
81 \begin{twocollist}\itemsep=0pt
82 \twocolitem{{\bf EVT\_TOOL(id, func)}}{Process a wxEVT\_COMMAND\_TOOL\_CLICKED event
83 (a synonym for wxEVT\_COMMAND\_MENU\_SELECTED). Pass the id of the tool.}
84 \twocolitem{{\bf EVT\_MENU(id, func)}}{The same as EVT\_TOOL.}
85 \twocolitem{{\bf EVT\_TOOL\_RANGE(id1, id2, func)}}{Process a wxEVT\_COMMAND\_TOOL\_CLICKED event
86 for a range id identifiers. Pass the ids of the tools.}
87 \twocolitem{{\bf EVT\_MENU\_RANGE(id1, id2, func)}}{The same as EVT\_TOOL\_RANGE.}
88
89 \twocolitem{{\bf EVT\_TOOL\_RCLICKED(id, func)}}{Process a wxEVT\_COMMAND\_TOOL\_RCLICKED event.
90 Pass the id of the tool.}
91 \twocolitem{{\bf EVT\_TOOL\_RCLICKED\_RANGE(id1, id2, func)}}{Process a wxEVT\_COMMAND\_TOOL\_RCLICKED event
92 for a range of ids. Pass the ids of the tools.}
93 \twocolitem{{\bf EVT\_TOOL\_ENTER(id, func)}}{Process a wxEVT\_COMMAND\_TOOL\_ENTER event.
94 Pass the id of the toolbar itself. The value of wxCommandEvent::GetSelection is the tool id, or -1 if the mouse cursor has moved off a tool.}
95 \end{twocollist}
96
97 \wxheading{See also}
98
99 \overview{Toolbar overview}{wxtoolbaroverview},\rtfsp
100 \helpref{wxScrolledWindow}{wxscrolledwindow}
101
102 \latexignore{\rtfignore{\wxheading{Members}}}
103
104 \membersection{wxToolBar::wxToolBar}\label{wxtoolbarconstr}
105
106 \func{}{wxToolBar}{\void}
107
108 Default constructor.
109
110 \func{}{wxToolBar}{\param{wxWindow*}{ parent}, \param{wxWindowID }{id},
111 \param{const wxPoint\& }{pos = wxDefaultPosition},
112 \param{const wxSize\& }{size = wxDefaultSize},
113 \param{long }{style = wxTB\_HORIZONTAL \pipe wxNO\_BORDER},
114 \param{const wxString\& }{name = wxPanelNameStr}}
115
116 Constructs a toolbar.
117
118 \wxheading{Parameters}
119
120 \docparam{parent}{Pointer to a parent window.}
121
122 \docparam{id}{Window identifier. If -1, will automatically create an identifier.}
123
124 \docparam{pos}{Window position. wxDefaultPosition is (-1, -1) which indicates that wxWindows
125 should generate a default position for the window. If using the wxWindow class directly, supply
126 an actual position.}
127
128 \docparam{size}{Window size. wxDefaultSize is (-1, -1) which indicates that wxWindows
129 should generate a default size for the window.}
130
131 \docparam{style}{Window style. See \helpref{wxToolBar}{wxtoolbar} for details.}
132
133 \docparam{name}{Window name.}
134
135 \wxheading{Remarks}
136
137 After a toolbar is created, you use \helpref{wxToolBar::AddTool}{wxtoolbaraddtool} and
138 perhaps \helpref{wxToolBar::AddSeparator}{wxtoolbaraddseparator}, and then you
139 must call \helpref{wxToolBar::Realize}{wxtoolbarrealize} to construct and display the toolbar
140 tools.
141
142 You may also create a toolbar that is managed by the frame, by
143 calling \helpref{wxFrame::CreateToolBar}{wxframecreatetoolbar}.
144
145 \membersection{wxToolBar::\destruct{wxToolBar}}
146
147 \func{void}{\destruct{wxToolBar}}{\void}
148
149 Toolbar destructor.
150
151 \membersection{wxToolBar::AddControl}\label{wxtoolbaraddcontrol}
152
153 \func{bool}{AddControl}{\param{wxControl*}{ control}}
154
155 Adds any control to the toolbar, typically e.g. a combobox.
156
157 \docparam{control}{The control to be added.}
158
159 \membersection{wxToolBar::AddSeparator}\label{wxtoolbaraddseparator}
160
161 \func{void}{AddSeparator}{\void}
162
163 Adds a separator for spacing groups of tools.
164
165 \wxheading{See also}
166
167 \helpref{wxToolBar::AddTool}{wxtoolbaraddtool}, \helpref{wxToolBar::SetToolSeparation}{wxtoolbarsettoolseparation}
168
169 \membersection{wxToolBar::AddTool}\label{wxtoolbaraddtool}
170
171 \func{wxToolBarTool*}{AddTool}{\param{int}{ toolId}, \param{const wxBitmap\&}{ bitmap1},\rtfsp
172 \param{const wxBitmap\&}{ bitmap2 = wxNullBitmap}, \param{bool}{ isToggle = FALSE},\rtfsp
173 \param{long}{ xPos = -1}, \param{long}{ yPos = -1},\rtfsp
174 \param{wxObject* }{clientData = NULL}, \param{const wxString\& }{shortHelpString = ""}, \param{const wxString\& }{longHelpString = ""}}
175
176 Adds a tool to the toolbar.
177
178 \wxheading{Parameters}
179
180 \docparam{toolId}{An integer by which
181 the tool may be identified in subsequent operations.}
182
183 \docparam{isToggle}{Specifies whether the tool is a toggle or not: a toggle tool may be in
184 two states, whereas a non-toggle tool is just a button.}
185
186 \docparam{bitmap1}{The primary tool bitmap for toggle and button tools.}
187
188 \docparam{bitmap2}{The second bitmap specifies the on-state bitmap for a toggle
189 tool. If this is wxNullBitmap, either an inverted version of the primary bitmap is
190 used for the on-state of a toggle tool (monochrome displays) or a black
191 border is drawn around the tool (colour displays) or the pixmap is shown
192 as a pressed button (GTK). }
193
194 \docparam{xPos}{Specifies the x position of the tool if automatic layout is not suitable.}
195
196 \docparam{yPos}{Specifies the y position of the tool if automatic layout is not suitable.}
197
198 \docparam{clientData}{An optional pointer to client data which can be
199 retrieved later using \helpref{wxToolBar::GetToolClientData}{wxtoolbargettoolclientdata}.}
200
201 \docparam{shortHelpString}{This string is used for the tools tooltip}
202
203 \docparam{longHelpString}{This string is shown in the statusbar (if any) of the
204 parent frame when the mouse pointer is inside the tool}
205
206 \wxheading{Remarks}
207
208 After you have added tools to a toolbar, you must call \helpref{wxToolBar::Realize}{wxtoolbarrealize} in
209 order to have the tools appear.
210
211 \wxheading{See also}
212
213 \helpref{wxToolBar::AddSeparator}{wxtoolbaraddseparator},
214 \helpref{wxToolBar::InsertTool}{wxtoolbarinserttool},
215 \helpref{wxToolBar::DeleteTool}{wxtoolbardeletetool},
216 \helpref{wxToolBar::Realize}{wxtoolbarrealize},
217
218 \membersection{wxToolBar::DeleteTool}\label{wxtoolbardeletetool}
219
220 \func{bool}{DeleteTool}{\param{int }{toolId}}
221
222 Removes the specified tool from the toolbar and deletes it. If you don't want
223 to delete the tool, but just to remove it from the toolbar (to possibly add it
224 back later), you may use \helpref{RemoveTool}{wxtoolbarremovetool} instead.
225
226 Note that it is unnecessary to call \helpref{Realize}{wxtoolbarrealize} for the
227 change to take place, it will happen immediately.
228
229 Returns TRUE if the tool was deleted, FALSE otherwise.
230
231 \wxheading{See also}
232
233 \helpref{DeleteToolByPos}{wxtoolbardeletetoolbypos}
234
235 \membersection{wxToolBar::DeleteToolByPos}\label{wxtoolbardeletetoolbypos}
236
237 \func{bool}{DeleteToolByPos}{\param{size\_t }{pos}}
238
239 This function behaves like \helpref{DeleteTool}{wxtoolbardeletetool} but it
240 deletes the tool at the specified position and not the one with the given id.
241
242 \membersection{wxToolBar::EnableTool}\label{wxtoolbarenabletool}
243
244 \func{void}{EnableTool}{\param{int }{toolId}, \param{const bool}{ enable}}
245
246 Enables or disables the tool.
247
248 \wxheading{Parameters}
249
250 \docparam{toolId}{Tool to enable or disable.}
251
252 \docparam{enable}{If TRUE, enables the tool, otherwise disables it.}
253
254 \wxheading{Remarks}
255
256 For wxToolBarSimple, does nothing. Some other implementations
257 will change the visible state of the tool to indicate that it is disabled.
258
259 \wxheading{See also}
260
261 \helpref{wxToolBar::GetToolEnabled}{wxtoolbargettoolenabled},\rtfsp
262 \helpref{wxToolBar::ToggleTool}{wxtoolbartoggletool}
263
264 \membersection{wxToolBar::FindToolForPosition}\label{wxtoolbarfindtoolforposition}
265
266 \constfunc{wxToolBarTool*}{FindToolForPosition}{\param{const float}{ x}, \param{const float}{ y}}
267
268 Finds a tool for the given mouse position.
269
270 \wxheading{Parameters}
271
272 \docparam{x}{X position.}
273
274 \docparam{y}{Y position.}
275
276 \wxheading{Return value}
277
278 A pointer to a tool if a tool is found, or NULL otherwise.
279
280 \wxheading{Remarks}
281
282 Used internally, and should not need to be used by the programmer.
283
284 \membersection{wxToolBar::GetToolSize}\label{wxtoolbargettoolsize}
285
286 \func{wxSize}{GetToolSize}{\void}
287
288 Returns the size of a whole button, which is usually larger than a tool bitmap because
289 of added 3D effects.
290
291 \wxheading{See also}
292
293 \helpref{wxToolBar::SetToolBitmapSize}{wxtoolbarsettoolbitmapsize},\rtfsp
294 \helpref{wxToolBar::GetToolBitmapSize}{wxtoolbargettoolbitmapsize}
295
296 \membersection{wxToolBar::GetToolBitmapSize}\label{wxtoolbargettoolbitmapsize}
297
298 \func{wxSize}{GetToolBitmapSize}{\void}
299
300 Returns the size of bitmap that the toolbar expects to have. The default bitmap size is 16 by 15 pixels.
301
302 \wxheading{Remarks}
303
304 Note that this is the size of the bitmap you pass to \helpref{wxToolBar::AddTool}{wxtoolbaraddtool},
305 and not the eventual size of the tool button.
306
307 \wxheading{See also}
308
309 \helpref{wxToolBar::SetToolBitmapSize}{wxtoolbarsettoolbitmapsize},\rtfsp
310 \helpref{wxToolBar::GetToolSize}{wxtoolbargettoolsize}
311
312 \membersection{wxToolBar::GetMargins}\label{wxtoolbargetmargins}
313
314 \constfunc{wxSize}{GetMargins}{\void}
315
316 Returns the left/right and top/bottom margins, which are also used for inter-toolspacing.
317
318 \wxheading{See also}
319
320 \helpref{wxToolBar::SetMargins}{wxtoolbarsetmargins}
321
322 \membersection{wxToolBar::GetToolClientData}\label{wxtoolbargettoolclientdata}
323
324 \constfunc{wxObject*}{GetToolClientData}{\param{int }{toolId}}
325
326 Get any client data associated with the tool.
327
328 \wxheading{Parameters}
329
330 \docparam{toolId}{Id of the tool, as passed to \helpref{wxToolBar::AddTool}{wxtoolbaraddtool}.}
331
332 \wxheading{Return value}
333
334 Client data, or NULL if there is none.
335
336 \membersection{wxToolBar::GetToolEnabled}\label{wxtoolbargettoolenabled}
337
338 \constfunc{bool}{GetToolEnabled}{\param{int }{toolId}}
339
340 Called to determine whether a tool is enabled (responds to user input).
341
342 \wxheading{Parameters}
343
344 \docparam{toolId}{Id of the tool in question.}
345
346 \wxheading{Return value}
347
348 TRUE if the tool is enabled, FALSE otherwise.
349
350 \wxheading{See also}
351
352 \helpref{wxToolBar::EnableTool}{wxtoolbarenabletool}
353
354 \membersection{wxToolBar::GetToolLongHelp}\label{wxtoolbargettoollonghelp}
355
356 \constfunc{wxString}{GetToolLongHelp}{\param{int }{toolId}}
357
358 Returns the long help for the given tool.
359
360 \wxheading{Parameters}
361
362 \docparam{toolId}{The tool in question.}
363
364 \wxheading{See also}
365
366 \helpref{wxToolBar::SetToolLongHelp}{wxtoolbarsettoollonghelp},\rtfsp
367 \helpref{wxToolBar::SetToolShortHelp}{wxtoolbarsettoolshorthelp}\rtfsp
368
369 \membersection{wxToolBar::GetToolPacking}\label{wxtoolbargettoolpacking}
370
371 \constfunc{int}{GetToolPacking}{\void}
372
373 Returns the value used for packing tools.
374
375 \wxheading{See also}
376
377 \helpref{wxToolBar::SetToolPacking}{wxtoolbarsettoolpacking}
378
379 \membersection{wxToolBar::GetToolSeparation}\label{wxtoolbargettoolseparation}
380
381 \constfunc{int}{GetToolSeparation}{\void}
382
383 Returns the default separator size.
384
385 \wxheading{See also}
386
387 \helpref{wxToolBar::SetToolSeparation}{wxtoolbarsettoolseparation}
388
389 \membersection{wxToolBar::GetToolShortHelp}\label{wxtoolbargettoolshorthelp}
390
391 \constfunc{wxString}{GetToolShortHelp}{\param{int }{toolId}}
392
393 Returns the short help for the given tool.
394
395 Returns the long help for the given tool.
396
397 \wxheading{Parameters}
398
399 \docparam{toolId}{The tool in question.}
400
401 \wxheading{See also}
402
403 \helpref{wxToolBar::GetToolLongHelp}{wxtoolbargettoollonghelp},\rtfsp
404 \helpref{wxToolBar::SetToolShortHelp}{wxtoolbarsettoolshorthelp}\rtfsp
405
406 \membersection{wxToolBar::GetToolState}\label{wxtoolbargettoolstate}
407
408 \constfunc{bool}{GetToolState}{\param{int }{toolId}}
409
410 Gets the on/off state of a toggle tool.
411
412 \wxheading{Parameters}
413
414 \docparam{toolId}{The tool in question.}
415
416 \wxheading{Return value}
417
418 TRUE if the tool is toggled on, FALSE otherwise.
419
420 \wxheading{See also}
421
422 \helpref{wxToolBar::ToggleTool}{wxtoolbartoggletool}
423
424 \membersection{wxToolBar::InsertControl}\label{wxtoolbarinsertcontrol}
425
426 \func{wxToolBarTool *}{InsertControl}{\param{size\_t }{pos}, \param{wxControl *}{control}}
427
428 Inserts the control into the toolbar at the given position.
429
430 You must call \helpref{Realize}{wxtoolbarrealize} for the change to take place.
431
432 \wxheading{See also}
433
434 \helpref{AddControl}{wxtoolbaraddcontrol},\\
435 \helpref{InsertTool}{wxtoolbarinserttool}
436
437 \membersection{wxToolBar::InsertSeparator}\label{wxtoolbarinsertseparator}
438
439 \func{wxToolBarTool *}{InsertSeparator}{\param{size\_t }{pos}}
440
441 Inserts the separator into the toolbar at the given position.
442
443 You must call \helpref{Realize}{wxtoolbarrealize} for the change to take place.
444
445 \wxheading{See also}
446
447 \helpref{AddSeparator}{wxtoolbaraddseparator},\\
448 \helpref{InsertTool}{wxtoolbarinserttool}
449
450 \membersection{wxToolBar::InsertTool}\label{wxtoolbarinserttool}
451
452 \func{wxToolBarTool *}{InsertTool}{\param{size\_t }{pos},\rtfsp
453 \param{int}{ toolId}, \param{const wxBitmap\&}{ bitmap1},\rtfsp
454 \param{const wxBitmap\&}{ bitmap2 = wxNullBitmap}, \param{bool}{ isToggle = FALSE},\rtfsp
455 \param{wxObject* }{clientData = NULL}, \param{const wxString\& }{shortHelpString = ""}, \param{const wxString\& }{longHelpString = ""}}
456
457 Inserts the tool with the specified attributes into the toolbar at the given
458 position.
459
460 You must call \helpref{Realize}{wxtoolbarrealize} for the change to take place.
461
462 \wxheading{See also}
463
464 \helpref{AddTool}{wxtoolbaraddtool},\\
465 \helpref{InsertControl}{wxtoolbarinsertcontrol},\\
466 \helpref{InsertSeparator}{wxtoolbarinsertseparator}
467
468 \membersection{wxToolBar::OnLeftClick}\label{wxtoolbaronleftclick}
469
470 \func{bool}{OnLeftClick}{\param{int}{ toolId}, \param{bool}{ toggleDown}}
471
472 Called when the user clicks on a tool with the left mouse button.
473
474 This is the old way of detecting tool clicks; although it will still work,
475 you should use the EVT\_MENU or EVT\_TOOL macro instead.
476
477 \wxheading{Parameters}
478
479 \docparam{toolId}{The identifier passed to \helpref{wxToolBar::AddTool}{wxtoolbaraddtool}.}
480
481 \docparam{toggleDown}{TRUE if the tool is a toggle and the toggle is down, otherwise is FALSE.}
482
483 \wxheading{Return value}
484
485 If the tool is a toggle and this function returns FALSE, the toggle
486 toggle state (internal and visual) will not be changed. This provides a way of
487 specifying that toggle operations are not permitted in some circumstances.
488
489 \wxheading{See also}
490
491 \helpref{wxToolBar::OnMouseEnter}{wxtoolbaronmouseenter},\rtfsp
492 \helpref{wxToolBar::OnRightClick}{wxtoolbaronrightclick}
493
494 \membersection{wxToolBar::OnMouseEnter}\label{wxtoolbaronmouseenter}
495
496 \func{void}{OnMouseEnter}{\param{int}{ toolId}}
497
498 This is called when the mouse cursor moves into a tool or out of
499 the toolbar.
500
501 This is the old way of detecting mouse enter events; although it will still work,
502 you should use the EVT\_TOOL\_ENTER macro instead.
503
504 \wxheading{Parameters}
505
506 \docparam{toolId}{Greater than -1 if the mouse cursor has moved into the tool,
507 or -1 if the mouse cursor has moved. The
508 programmer can override this to provide extra information about the tool,
509 such as a short description on the status line.}
510
511 \wxheading{Remarks}
512
513 With some derived toolbar classes, if the mouse moves quickly out of the toolbar, wxWindows may not be able to
514 detect it. Therefore this function may not always be called when expected.
515
516 \membersection{wxToolBar::OnRightClick}\label{wxtoolbaronrightclick}
517
518 \func{void}{OnRightClick}{\param{int}{ toolId}, \param{float}{ x}, \param{float}{ y}}
519
520 Called when the user clicks on a tool with the right mouse button. The
521 programmer should override this function to detect right tool clicks.
522
523 This is the old way of detecting tool right clicks; although it will still work,
524 you should use the EVT\_TOOL\_RCLICKED macro instead.
525
526 \wxheading{Parameters}
527
528 \docparam{toolId}{The identifier passed to \helpref{wxToolBar::AddTool}{wxtoolbaraddtool}.}
529
530 \docparam{x}{The x position of the mouse cursor.}
531
532 \docparam{y}{The y position of the mouse cursor.}
533
534 \wxheading{Remarks}
535
536 A typical use of this member might be to pop up a menu.
537
538 \wxheading{See also}
539
540 \helpref{wxToolBar::OnMouseEnter}{wxtoolbaronmouseenter},\rtfsp
541 \helpref{wxToolBar::OnLeftClick}{wxtoolbaronleftclick}
542
543 \membersection{wxToolBar::Realize}\label{wxtoolbarrealize}
544
545 \func{bool}{Realize}{\void}
546
547 This function should be called after you have added tools.
548
549 If you are using absolute positions for your tools when using a wxToolBarSimple object,
550 do not call this function. You must call it at all other times.
551
552 \membersection{wxToolBar::RemoveTool}\label{wxtoolbarremovetool}
553
554 \func{wxToolBarTool *}{RemoveTool}{\param{int }{id}}
555
556 Removes the given tool from the toolbar but doesn't delete it. This allows to
557 insert/add this tool back to this (or another) toolbar later.
558
559 Note that it is unnecessary to call \helpref{Realize}{wxtoolbarrealize} for the
560 change to take place, it will happen immediately.
561
562 \wxheading{See also}
563
564 \helpref{DeleteTool}{wxtoolbardeletetool}
565
566 \membersection{wxToolBar::SetMargins}\label{wxtoolbarsetmargins}
567
568 \func{void}{SetMargins}{\param{const wxSize\&}{ size}}
569
570 \func{void}{SetMargins}{\param{int}{ x}, \param{int}{ y}}
571
572 Set the values to be used as margins for the toolbar.
573
574 \wxheading{Parameters}
575
576 \docparam{size}{Margin size.}
577
578 \docparam{x}{Left margin, right margin and inter-tool separation value.}
579
580 \docparam{y}{Top margin, bottom margin and inter-tool separation value.}
581
582 \wxheading{Remarks}
583
584 This must be called before the tools are added if absolute positioning is to be used, and the
585 default (zero-size) margins are to be overridden.
586
587 \wxheading{See also}
588
589 \helpref{wxToolBar::GetMargins}{wxtoolbargetmargins}, \helpref{wxSize}{wxsize}
590
591 \membersection{wxToolBar::SetToolBitmapSize}\label{wxtoolbarsettoolbitmapsize}
592
593 \func{void}{SetToolBitmapSize}{\param{const wxSize\&}{ size}}
594
595 Sets the default size of each tool bitmap. The default bitmap size is 16 by 15 pixels.
596
597 \wxheading{Parameters}
598
599 \docparam{size}{The size of the bitmaps in the toolbar.}
600
601 \wxheading{Remarks}
602
603 This should be called to tell the toolbar what the tool bitmap size is. Call
604 it before you add tools.
605
606 Note that this is the size of the bitmap you pass to \helpref{wxToolBar::AddTool}{wxtoolbaraddtool},
607 and not the eventual size of the tool button.
608
609 \wxheading{See also}
610
611 \helpref{wxToolBar::GetToolBitmapSize}{wxtoolbargettoolbitmapsize},\rtfsp
612 \helpref{wxToolBar::GetToolSize}{wxtoolbargettoolsize}
613
614 \membersection{wxToolBar::SetToolClientData}\label{wxtoolbarsettoolclientdata}
615
616 \func{void}{GetToolClientData}{\param{wxObject* }{clientData}}
617
618 Sets the client data associated with the tool.
619
620 \membersection{wxToolBar::SetToolLongHelp}\label{wxtoolbarsettoollonghelp}
621
622 \func{void}{SetToolLongHelp}{\param{int }{toolId}, \param{const wxString\& }{helpString}}
623
624 Sets the long help for the given tool.
625
626 \wxheading{Parameters}
627
628 \docparam{toolId}{The tool in question.}
629
630 \docparam{helpString}{A string for the long help.}
631
632 \wxheading{Remarks}
633
634 You might use the long help for displaying the tool purpose on the status line.
635
636 \wxheading{See also}
637
638 \helpref{wxToolBar::GetToolLongHelp}{wxtoolbargettoollonghelp},\rtfsp
639 \helpref{wxToolBar::SetToolShortHelp}{wxtoolbarsettoolshorthelp},\rtfsp
640
641 \membersection{wxToolBar::SetToolPacking}\label{wxtoolbarsettoolpacking}
642
643 \func{void}{SetToolPacking}{\param{int}{ packing}}
644
645 Sets the value used for spacing tools. The default value is 1.
646
647 \wxheading{Parameters}
648
649 \docparam{packing}{The value for packing.}
650
651 \wxheading{Remarks}
652
653 The packing is used for spacing in the vertical direction if the toolbar is horizontal,
654 and for spacing in the horizontal direction if the toolbar is vertical.
655
656 \wxheading{See also}
657
658 \helpref{wxToolBar::GetToolPacking}{wxtoolbargettoolpacking}
659
660 \membersection{wxToolBar::SetToolShortHelp}\label{wxtoolbarsettoolshorthelp}
661
662 \func{void}{SetToolShortHelp}{\param{int }{toolId}, \param{const wxString\& }{helpString}}
663
664 Sets the short help for the given tool.
665
666 \wxheading{Parameters}
667
668 \docparam{toolId}{The tool in question.}
669
670 \docparam{helpString}{The string for the short help.}
671
672 \wxheading{Remarks}
673
674 An application might use short help for identifying the tool purpose in a tooltip.
675
676 \wxheading{See also}
677
678 \helpref{wxToolBar::GetToolShortHelp}{wxtoolbargettoolshorthelp}, \helpref{wxToolBar::SetToolLongHelp}{wxtoolbarsettoollonghelp}
679
680 \membersection{wxToolBar::SetToolSeparation}\label{wxtoolbarsettoolseparation}
681
682 \func{void}{SetToolSeparation}{\param{int}{ separation}}
683
684 Sets the default separator size. The default value is 5.
685
686 \wxheading{Parameters}
687
688 \docparam{separation}{The separator size.}
689
690 \wxheading{See also}
691
692 \helpref{wxToolBar::AddSeparator}{wxtoolbaraddseparator}
693
694 \membersection{wxToolBar::ToggleTool}\label{wxtoolbartoggletool}
695
696 \func{void}{ToggleTool}{\param{int }{toolId}, \param{const bool}{ toggle}}
697
698 Toggles a tool on or off. This does not cause any event to get emitted.
699
700 \wxheading{Parameters}
701
702 \docparam{toolId}{Tool in question.}
703
704 \docparam{toggle}{If TRUE, toggles the tool on, otherwise toggles it off.}
705
706 \wxheading{Remarks}
707
708 Only applies to a tool that has been specified as a toggle tool.
709
710 \wxheading{See also}
711
712 \helpref{wxToolBar::GetToolState}{wxtoolbargettoolstate}
713
714