]>
Commit | Line | Data |
---|---|---|
f8ecadbf VZ |
1 | /////////////////////////////////////////////////////////////////////////////// |
2 | // Name: wx/aui/toolbar.h | |
3 | // Purpose: Documentation of wxAuiToolBar and related classes. | |
4 | // Created: 2011-01-17 | |
f8ecadbf VZ |
5 | // Copyright: (c) 2011 wxWidgets development team |
6 | // Licence: wxWindows licence | |
7 | /////////////////////////////////////////////////////////////////////////////// | |
8 | ||
9 | /** | |
c55488df VZ |
10 | wxAuiToolBarStyle is part of the wxAUI class framework, used to define the appearance of a wxAuiToolBar. |
11 | ||
12 | See also @ref overview_aui. | |
13 | ||
f8ecadbf VZ |
14 | @library{wxaui} |
15 | @category{aui} | |
16 | */ | |
17 | enum wxAuiToolBarStyle | |
18 | { | |
c55488df VZ |
19 | /** |
20 | Shows the text in the toolbar buttons; by default only icons are shown. | |
21 | */ | |
f8ecadbf | 22 | wxAUI_TB_TEXT = 1 << 0, |
c55488df VZ |
23 | |
24 | /** | |
25 | Don't show tooltips on wxAuiToolBar items. | |
26 | */ | |
f8ecadbf | 27 | wxAUI_TB_NO_TOOLTIPS = 1 << 1, |
c55488df VZ |
28 | |
29 | /** | |
30 | Do not auto-resize the wxAuiToolBar. | |
31 | */ | |
f8ecadbf | 32 | wxAUI_TB_NO_AUTORESIZE = 1 << 2, |
c55488df VZ |
33 | |
34 | /** | |
35 | Shows a gripper on the wxAuiToolBar. | |
36 | */ | |
f8ecadbf | 37 | wxAUI_TB_GRIPPER = 1 << 3, |
c55488df VZ |
38 | |
39 | /** | |
40 | The wxAuiToolBar can contain overflow items. | |
41 | */ | |
f8ecadbf | 42 | wxAUI_TB_OVERFLOW = 1 << 4, |
c55488df | 43 | |
f8ecadbf | 44 | /** |
c55488df VZ |
45 | Using this style forces the toolbar to be vertical and be only dockable to the left or right sides of the window whereas by default it can be horizontal or vertical and be docked anywhere. |
46 | */ | |
f8ecadbf | 47 | wxAUI_TB_VERTICAL = 1 << 5, |
c55488df VZ |
48 | |
49 | /** | |
50 | Shows the text and the icons alongside, not vertically stacked. This style must be used with wxAUI_TB_TEXT | |
51 | */ | |
f8ecadbf | 52 | wxAUI_TB_HORZ_LAYOUT = 1 << 6, |
c55488df | 53 | |
f8ecadbf | 54 | /** |
c55488df VZ |
55 | Analogous to wxAUI_TB_VERTICAL, but forces the toolbar to be horizontal, docking to the top or bottom of the window. |
56 | */ | |
f8ecadbf | 57 | wxAUI_TB_HORIZONTAL = 1 << 7, |
c55488df | 58 | |
526502d1 VZ |
59 | |
60 | /** | |
61 | Draw a plain background (based on parent) instead of the default gradient background. | |
62 | ||
63 | @since 2.9.5 | |
64 | */ | |
65 | wxAUI_TB_PLAIN_BACKGROUND = 1 << 8, | |
66 | ||
c55488df VZ |
67 | /** |
68 | Shows the text alongside the icons, not vertically stacked. | |
69 | */ | |
f8ecadbf | 70 | wxAUI_TB_HORZ_TEXT = (wxAUI_TB_HORZ_LAYOUT | wxAUI_TB_TEXT), |
c55488df VZ |
71 | |
72 | /** | |
73 | Shows the text in the toolbar buttons; by default only icons are shown. | |
74 | */ | |
f8ecadbf | 75 | wxAUI_ORIENTATION_MASK = (wxAUI_TB_VERTICAL | wxAUI_TB_HORIZONTAL), |
c55488df VZ |
76 | |
77 | /** | |
78 | By default only icons are shown. | |
79 | */ | |
f8ecadbf | 80 | wxAUI_TB_DEFAULT_STYLE = 0 |
c55488df | 81 | |
f8ecadbf VZ |
82 | }; |
83 | ||
84 | /** | |
c55488df VZ |
85 | wxAuiToolBarArtSetting |
86 | ||
87 | @library{wxaui} | |
88 | @category{aui} | |
89 | */ | |
f8ecadbf VZ |
90 | enum wxAuiToolBarArtSetting |
91 | { | |
c55488df VZ |
92 | /** |
93 | wxAuiToolBar seperator size. | |
94 | */ | |
f8ecadbf | 95 | wxAUI_TBART_SEPARATOR_SIZE = 0, |
c55488df VZ |
96 | |
97 | /** | |
98 | wxAuiToolBar gripper size. | |
99 | */ | |
f8ecadbf | 100 | wxAUI_TBART_GRIPPER_SIZE = 1, |
c55488df VZ |
101 | |
102 | /** | |
103 | Overflow button size in wxAuiToolBar. | |
104 | */ | |
f8ecadbf | 105 | wxAUI_TBART_OVERFLOW_SIZE = 2 |
c55488df | 106 | |
f8ecadbf VZ |
107 | }; |
108 | ||
109 | /** | |
c55488df VZ |
110 | wxAuiToolBarToolTextOrientation |
111 | ||
f8ecadbf VZ |
112 | @library{wxaui} |
113 | @category{aui} | |
114 | */ | |
115 | enum wxAuiToolBarToolTextOrientation | |
116 | { | |
c55488df VZ |
117 | /** |
118 | Text in wxAuiToolBar items is left aligned, currently unused/unimplemented. | |
119 | */ | |
120 | wxAUI_TBTOOL_TEXT_LEFT = 0, | |
121 | ||
122 | /** | |
123 | Text in wxAuiToolBar items is right aligned. | |
124 | */ | |
f8ecadbf | 125 | wxAUI_TBTOOL_TEXT_RIGHT = 1, |
c55488df VZ |
126 | |
127 | /** | |
128 | Text in wxAuiToolBar items is top aligned, currently unused/unimplemented. | |
129 | */ | |
130 | wxAUI_TBTOOL_TEXT_TOP = 2, | |
131 | ||
132 | /** | |
133 | Text in wxAuiToolBar items is bottom aligned. | |
134 | */ | |
f8ecadbf | 135 | wxAUI_TBTOOL_TEXT_BOTTOM = 3 |
c55488df | 136 | |
f8ecadbf VZ |
137 | }; |
138 | ||
139 | ||
140 | /** | |
141 | @class wxAuiToolBarEvent | |
142 | ||
143 | wxAuiToolBarEvent is used for the events generated by @ref wxAuiToolBar. | |
144 | ||
145 | @library{wxaui} | |
146 | @category{aui} | |
147 | */ | |
148 | class wxAuiToolBarEvent : public wxNotifyEvent | |
149 | { | |
150 | public: | |
c55488df VZ |
151 | /** |
152 | Returns whether the drop down menu has been clicked. | |
153 | */ | |
f8ecadbf VZ |
154 | bool IsDropDownClicked() const; |
155 | ||
c55488df VZ |
156 | /** |
157 | Returns the point where the user clicked with the mouse. | |
158 | */ | |
f8ecadbf VZ |
159 | wxPoint GetClickPoint() const; |
160 | ||
c55488df VZ |
161 | /** |
162 | Returns the wxAuiToolBarItem rectangle bounding the mouse click point. | |
163 | */ | |
f8ecadbf VZ |
164 | wxRect GetItemRect() const; |
165 | ||
c55488df VZ |
166 | /** |
167 | Returns the wxAuiToolBarItem identifier. | |
168 | */ | |
f8ecadbf VZ |
169 | int GetToolId() const; |
170 | }; | |
171 | ||
172 | ||
173 | /** | |
174 | @class wxAuiToolBarItem | |
175 | ||
c55488df VZ |
176 | wxAuiToolBarItem is part of the wxAUI class framework, representing a toolbar element. |
177 | ||
f8ecadbf VZ |
178 | See also @ref wxAuiToolBar and @ref overview_aui. |
179 | ||
c55488df VZ |
180 | It has a unique id (except for the separators which always have id = -1), the |
181 | style (telling whether it is a normal button, separator or a control), the | |
182 | state (toggled or not, enabled or not) and short and long help strings. The | |
183 | default implementations use the short help string for the tooltip text which | |
184 | is popped up when the mouse pointer enters the tool and the long help string | |
185 | for the applications status bar (currently not implemented). | |
186 | ||
f8ecadbf VZ |
187 | @library{wxaui} |
188 | @category{aui} | |
189 | */ | |
190 | class wxAuiToolBarItem | |
191 | { | |
192 | public: | |
193 | ||
c55488df VZ |
194 | /** |
195 | Default Constructor | |
196 | */ | |
f8ecadbf VZ |
197 | wxAuiToolBarItem(); |
198 | ||
c55488df VZ |
199 | /** |
200 | Assigns the properties of the wxAuiToolBarItem "c" to this. | |
201 | */ | |
f8ecadbf VZ |
202 | wxAuiToolBarItem(const wxAuiToolBarItem& c); |
203 | ||
c55488df VZ |
204 | /** |
205 | Assigns the properties of the wxAuiToolBarItem "c" to this, returning a pointer to this. | |
206 | */ | |
f8ecadbf VZ |
207 | wxAuiToolBarItem& operator=(const wxAuiToolBarItem& c); |
208 | ||
c55488df VZ |
209 | /** |
210 | Assigns the properties of the wxAuiToolBarItem "c" to this. | |
211 | */ | |
f8ecadbf VZ |
212 | void Assign(const wxAuiToolBarItem& c); |
213 | ||
c55488df VZ |
214 | /** |
215 | Assigns a window to the toolbar item. | |
216 | */ | |
f8ecadbf | 217 | void SetWindow(wxWindow* w); |
c55488df VZ |
218 | /** |
219 | Returns the wxWindow* associated to the toolbar item. | |
220 | */ | |
f8ecadbf VZ |
221 | wxWindow* GetWindow(); |
222 | ||
c55488df VZ |
223 | /** |
224 | Sets the toolbar item identifier. | |
225 | */ | |
f8ecadbf | 226 | void SetId(int new_id); |
c55488df VZ |
227 | /** |
228 | Returns the toolbar item identifier. | |
229 | */ | |
f8ecadbf VZ |
230 | int GetId() const; |
231 | ||
c55488df VZ |
232 | /** |
233 | Sets the wxAuiToolBarItem kind. | |
234 | */ | |
f8ecadbf | 235 | void SetKind(int new_kind); |
c55488df VZ |
236 | |
237 | /** | |
238 | Returns the toolbar item kind. | |
239 | */ | |
f8ecadbf VZ |
240 | int GetKind() const; |
241 | ||
c55488df VZ |
242 | /** |
243 | ||
244 | */ | |
f8ecadbf | 245 | void SetState(int new_state); |
c55488df VZ |
246 | /** |
247 | ||
248 | */ | |
f8ecadbf VZ |
249 | int GetState() const; |
250 | ||
c55488df VZ |
251 | /** |
252 | ||
253 | */ | |
f8ecadbf | 254 | void SetSizerItem(wxSizerItem* s); |
c55488df VZ |
255 | /** |
256 | ||
257 | */ | |
f8ecadbf VZ |
258 | wxSizerItem* GetSizerItem() const; |
259 | ||
c55488df VZ |
260 | /** |
261 | ||
262 | */ | |
f8ecadbf | 263 | void SetLabel(const wxString& s); |
c55488df VZ |
264 | /** |
265 | ||
266 | */ | |
f8ecadbf VZ |
267 | const wxString& GetLabel() const; |
268 | ||
c55488df VZ |
269 | /** |
270 | ||
271 | */ | |
f8ecadbf | 272 | void SetBitmap(const wxBitmap& bmp); |
c55488df VZ |
273 | /** |
274 | ||
275 | */ | |
f8ecadbf VZ |
276 | const wxBitmap& GetBitmap() const; |
277 | ||
c55488df VZ |
278 | /** |
279 | ||
280 | */ | |
f8ecadbf | 281 | void SetDisabledBitmap(const wxBitmap& bmp); |
c55488df VZ |
282 | /** |
283 | ||
284 | */ | |
f8ecadbf VZ |
285 | const wxBitmap& GetDisabledBitmap() const; |
286 | ||
c55488df VZ |
287 | /** |
288 | ||
289 | */ | |
f8ecadbf | 290 | void SetHoverBitmap(const wxBitmap& bmp); |
c55488df VZ |
291 | /** |
292 | ||
293 | */ | |
f8ecadbf VZ |
294 | const wxBitmap& GetHoverBitmap() const; |
295 | ||
c55488df VZ |
296 | /** |
297 | ||
298 | */ | |
f8ecadbf | 299 | void SetShortHelp(const wxString& s); |
c55488df VZ |
300 | /** |
301 | ||
302 | */ | |
f8ecadbf VZ |
303 | const wxString& GetShortHelp() const; |
304 | ||
c55488df VZ |
305 | /** |
306 | ||
307 | */ | |
f8ecadbf | 308 | void SetLongHelp(const wxString& s); |
c55488df VZ |
309 | /** |
310 | ||
311 | */ | |
f8ecadbf VZ |
312 | const wxString& GetLongHelp() const; |
313 | ||
c55488df VZ |
314 | /** |
315 | ||
316 | */ | |
f8ecadbf | 317 | void SetMinSize(const wxSize& s); |
c55488df VZ |
318 | /** |
319 | ||
320 | */ | |
f8ecadbf VZ |
321 | const wxSize& GetMinSize() const; |
322 | ||
c55488df VZ |
323 | /** |
324 | ||
325 | */ | |
f8ecadbf | 326 | void SetSpacerPixels(int s); |
c55488df VZ |
327 | /** |
328 | ||
329 | */ | |
f8ecadbf VZ |
330 | int GetSpacerPixels() const; |
331 | ||
c55488df VZ |
332 | /** |
333 | ||
334 | */ | |
f8ecadbf | 335 | void SetProportion(int p); |
c55488df VZ |
336 | /** |
337 | ||
338 | */ | |
f8ecadbf VZ |
339 | int GetProportion() const; |
340 | ||
c55488df VZ |
341 | /** |
342 | ||
343 | */ | |
f8ecadbf | 344 | void SetActive(bool b); |
c55488df VZ |
345 | /** |
346 | ||
347 | */ | |
f8ecadbf VZ |
348 | bool IsActive() const; |
349 | ||
c55488df | 350 | /** |
72ae0b51 | 351 | Set whether this tool has a drop down button. |
c55488df | 352 | |
72ae0b51 | 353 | This is only valid for wxITEM_NORMAL tools. |
c55488df | 354 | */ |
f8ecadbf | 355 | void SetHasDropDown(bool b); |
c55488df | 356 | /** |
72ae0b51 | 357 | Returns whether the toolbar item has an associated drop down button. |
c55488df | 358 | */ |
f8ecadbf VZ |
359 | bool HasDropDown() const; |
360 | ||
c55488df VZ |
361 | /** |
362 | ||
363 | */ | |
f8ecadbf | 364 | void SetSticky(bool b); |
c55488df VZ |
365 | /** |
366 | ||
367 | */ | |
f8ecadbf VZ |
368 | bool IsSticky() const; |
369 | ||
c55488df VZ |
370 | /** |
371 | ||
372 | */ | |
f8ecadbf | 373 | void SetUserData(long l); |
c55488df VZ |
374 | /** |
375 | ||
376 | */ | |
f8ecadbf VZ |
377 | long GetUserData() const; |
378 | ||
c55488df VZ |
379 | /** |
380 | ||
381 | */ | |
f8ecadbf | 382 | void SetAlignment(int l); |
c55488df VZ |
383 | /** |
384 | ||
385 | */ | |
f8ecadbf VZ |
386 | int GetAlignment() const; |
387 | }; | |
388 | ||
389 | /** | |
390 | @class wxAuiToolBarArt | |
391 | ||
392 | wxAuiToolBarArt is part of the wxAUI class framework. | |
393 | See also @ref wxAuiToolBar and @ref overview_aui. | |
394 | ||
395 | @library{wxaui} | |
396 | @category{aui} | |
397 | */ | |
398 | class wxAuiToolBarArt | |
399 | { | |
400 | public: | |
401 | wxAuiToolBarArt(); | |
402 | ||
403 | virtual wxAuiToolBarArt* Clone() = 0; | |
404 | virtual void SetFlags(unsigned int flags) = 0; | |
405 | virtual unsigned int GetFlags() = 0; | |
406 | virtual void SetFont(const wxFont& font) = 0; | |
407 | virtual wxFont GetFont() = 0; | |
408 | virtual void SetTextOrientation(int orientation) = 0; | |
409 | virtual int GetTextOrientation() = 0; | |
410 | ||
411 | virtual void DrawBackground( | |
412 | wxDC& dc, | |
413 | wxWindow* wnd, | |
414 | const wxRect& rect) = 0; | |
415 | ||
526502d1 VZ |
416 | virtual void DrawPlainBackground( |
417 | wxDC& dc, | |
418 | wxWindow* wnd, | |
419 | const wxRect& rect) = 0; | |
420 | ||
f8ecadbf VZ |
421 | virtual void DrawLabel( |
422 | wxDC& dc, | |
423 | wxWindow* wnd, | |
424 | const wxAuiToolBarItem& item, | |
425 | const wxRect& rect) = 0; | |
426 | ||
427 | virtual void DrawButton( | |
428 | wxDC& dc, | |
429 | wxWindow* wnd, | |
430 | const wxAuiToolBarItem& item, | |
431 | const wxRect& rect) = 0; | |
432 | ||
433 | virtual void DrawDropDownButton( | |
434 | wxDC& dc, | |
435 | wxWindow* wnd, | |
436 | const wxAuiToolBarItem& item, | |
437 | const wxRect& rect) = 0; | |
438 | ||
439 | virtual void DrawControlLabel( | |
440 | wxDC& dc, | |
441 | wxWindow* wnd, | |
442 | const wxAuiToolBarItem& item, | |
443 | const wxRect& rect) = 0; | |
444 | ||
445 | virtual void DrawSeparator( | |
446 | wxDC& dc, | |
447 | wxWindow* wnd, | |
448 | const wxRect& rect) = 0; | |
449 | ||
450 | virtual void DrawGripper( | |
451 | wxDC& dc, | |
452 | wxWindow* wnd, | |
453 | const wxRect& rect) = 0; | |
454 | ||
455 | virtual void DrawOverflowButton( | |
456 | wxDC& dc, | |
457 | wxWindow* wnd, | |
458 | const wxRect& rect, | |
459 | int state) = 0; | |
460 | ||
461 | virtual wxSize GetLabelSize( | |
462 | wxDC& dc, | |
463 | wxWindow* wnd, | |
464 | const wxAuiToolBarItem& item) = 0; | |
465 | ||
466 | virtual wxSize GetToolSize( | |
467 | wxDC& dc, | |
468 | wxWindow* wnd, | |
469 | const wxAuiToolBarItem& item) = 0; | |
470 | ||
471 | virtual int GetElementSize(int element_id) = 0; | |
472 | virtual void SetElementSize(int element_id, int size) = 0; | |
473 | ||
474 | virtual int ShowDropDown( | |
475 | wxWindow* wnd, | |
476 | const wxAuiToolBarItemArray& items) = 0; | |
477 | }; | |
478 | ||
479 | ||
480 | /** | |
481 | @class wxAuiDefaultToolBarArt | |
482 | ||
483 | wxAuiDefaultToolBarArt is part of the wxAUI class framework. | |
484 | See also @ref wxAuiToolBarArt , @ref wxAuiToolBar and @ref overview_aui. | |
485 | ||
486 | @library{wxaui} | |
487 | @category{aui} | |
488 | */ | |
489 | class wxAuiDefaultToolBarArt : public wxAuiToolBarArt | |
490 | { | |
491 | public: | |
492 | wxAuiDefaultToolBarArt(); | |
493 | virtual ~wxAuiDefaultToolBarArt(); | |
494 | ||
495 | virtual wxAuiToolBarArt* Clone(); | |
496 | virtual void SetFlags(unsigned int flags); | |
497 | virtual unsigned int GetFlags(); | |
498 | virtual void SetFont(const wxFont& font); | |
499 | virtual wxFont GetFont(); | |
500 | virtual void SetTextOrientation(int orientation); | |
501 | virtual int GetTextOrientation(); | |
502 | ||
503 | virtual void DrawBackground( | |
504 | wxDC& dc, | |
505 | wxWindow* wnd, | |
506 | const wxRect& rect); | |
507 | ||
526502d1 VZ |
508 | virtual void DrawPlainBackground(wxDC& dc, |
509 | wxWindow* wnd, | |
510 | const wxRect& rect); | |
511 | ||
f8ecadbf VZ |
512 | virtual void DrawLabel( |
513 | wxDC& dc, | |
514 | wxWindow* wnd, | |
515 | const wxAuiToolBarItem& item, | |
516 | const wxRect& rect); | |
517 | ||
518 | virtual void DrawButton( | |
519 | wxDC& dc, | |
520 | wxWindow* wnd, | |
521 | const wxAuiToolBarItem& item, | |
522 | const wxRect& rect); | |
523 | ||
524 | virtual void DrawDropDownButton( | |
525 | wxDC& dc, | |
526 | wxWindow* wnd, | |
527 | const wxAuiToolBarItem& item, | |
528 | const wxRect& rect); | |
529 | ||
530 | virtual void DrawControlLabel( | |
531 | wxDC& dc, | |
532 | wxWindow* wnd, | |
533 | const wxAuiToolBarItem& item, | |
534 | const wxRect& rect); | |
535 | ||
536 | virtual void DrawSeparator( | |
537 | wxDC& dc, | |
538 | wxWindow* wnd, | |
539 | const wxRect& rect); | |
540 | ||
541 | virtual void DrawGripper( | |
542 | wxDC& dc, | |
543 | wxWindow* wnd, | |
544 | const wxRect& rect); | |
545 | ||
546 | virtual void DrawOverflowButton( | |
547 | wxDC& dc, | |
548 | wxWindow* wnd, | |
549 | const wxRect& rect, | |
550 | int state); | |
551 | ||
552 | virtual wxSize GetLabelSize( | |
553 | wxDC& dc, | |
554 | wxWindow* wnd, | |
555 | const wxAuiToolBarItem& item); | |
556 | ||
557 | virtual wxSize GetToolSize( | |
558 | wxDC& dc, | |
559 | wxWindow* wnd, | |
560 | const wxAuiToolBarItem& item); | |
561 | ||
562 | virtual int GetElementSize(int element); | |
563 | virtual void SetElementSize(int element_id, int size); | |
564 | ||
565 | virtual int ShowDropDown(wxWindow* wnd, | |
566 | const wxAuiToolBarItemArray& items); | |
567 | }; | |
568 | ||
569 | ||
570 | ||
571 | /** | |
572 | @class wxAuiToolBar | |
573 | ||
574 | wxAuiToolBar is a dockable toolbar, part of the wxAUI class framework. | |
575 | See also @ref overview_aui. | |
576 | ||
577 | @beginStyleTable | |
578 | @style{wxAUI_TB_TEXT} | |
579 | @style{wxAUI_TB_NO_TOOLTIPS} | |
580 | @style{wxAUI_TB_NO_AUTORESIZE} | |
581 | @style{wxAUI_TB_GRIPPER} | |
582 | @style{wxAUI_TB_OVERFLOW} | |
583 | @style{wxAUI_TB_VERTICAL} | |
584 | using this style forces the toolbar to be vertical and | |
585 | be only dockable to the left or right sides of the window | |
586 | whereas by default it can be horizontal or vertical and | |
587 | be docked anywhere | |
588 | @style{wxAUI_TB_HORZ_LAYOUT} | |
589 | @style{wxAUI_TB_HORIZONTAL} | |
590 | analogous to wxAUI_TB_VERTICAL, but forces the toolbar | |
591 | to be horizontal | |
526502d1 VZ |
592 | @style{wxAUI_TB_PLAIN_BACKGROUND} |
593 | Draw a plain background (based on parent) instead of the | |
594 | default gradient background. | |
f8ecadbf VZ |
595 | @style{wxAUI_TB_HORZ_TEXT} |
596 | Equivalent to wxAUI_TB_HORZ_LAYOUT | wxAUI_TB_TEXT | |
597 | @style{wxAUI_TB_DEFAULT_STYLE} | |
598 | The default is to have no styles | |
599 | @endStyleTable | |
600 | ||
601 | @beginEventEmissionTable{wxAuiToolBarEvent} | |
602 | @event{EVT_AUITOOLBAR_TOOL_DROPDOWN(id, func)} | |
ce7fe42e | 603 | Process a wxEVT_AUITOOLBAR_TOOL_DROPDOWN event |
f8ecadbf | 604 | @event{EVT_AUITOOLBAR_OVERFLOW_CLICK(id, func)} |
ce7fe42e | 605 | Process a wxEVT_AUITOOLBAR_OVERFLOW_CLICK event |
f8ecadbf | 606 | @event{EVT_AUITOOLBAR_RIGHT_CLICK(id, func)} |
ce7fe42e | 607 | Process a wxEVT_AUITOOLBAR_RIGHT_CLICK event |
f8ecadbf | 608 | @event{EVT_AUITOOLBAR_MIDDLE_CLICK(id, func)} |
ce7fe42e | 609 | Process a wxEVT_AUITOOLBAR_MIDDLE_CLICK event |
f8ecadbf | 610 | @event{EVT_AUITOOLBAR_BEGIN_DRAG(id, func)} |
ce7fe42e | 611 | Process a wxEVT_AUITOOLBAR_BEGIN_DRAG event |
f8ecadbf VZ |
612 | @endEventTable |
613 | ||
614 | @library{wxaui} | |
615 | @category{aui} | |
616 | */ | |
617 | class wxAuiToolBar : public wxControl | |
618 | { | |
619 | public: | |
46e67202 VZ |
620 | /** |
621 | Default constructor, use Create() later. | |
622 | ||
623 | @since 2.9.5 | |
624 | */ | |
625 | wxAuiToolBar(); | |
626 | ||
627 | /** | |
628 | Constructor creating and initializing the object. | |
629 | */ | |
f8ecadbf | 630 | wxAuiToolBar(wxWindow* parent, |
46e67202 | 631 | wxWindowID id = wxID_ANY, |
f8ecadbf VZ |
632 | const wxPoint& position = wxDefaultPosition, |
633 | const wxSize& size = wxDefaultSize, | |
634 | long style = wxAUI_TB_DEFAULT_STYLE); | |
46e67202 VZ |
635 | |
636 | /** | |
637 | Really create wxAuiToolBar created using default constructor. | |
638 | ||
639 | @since 2.9.5 | |
640 | */ | |
641 | bool Create(wxWindow* parent, | |
642 | wxWindowID id = wxID_ANY, | |
643 | const wxPoint& pos = wxDefaultPosition, | |
644 | const wxSize& size = wxDefaultSize, | |
645 | long style = wxAUI_TB_DEFAULT_STYLE); | |
f8ecadbf VZ |
646 | virtual ~wxAuiToolBar(); |
647 | ||
648 | void SetWindowStyleFlag(long style); | |
649 | long GetWindowStyleFlag() const; | |
650 | ||
651 | void SetArtProvider(wxAuiToolBarArt* art); | |
652 | wxAuiToolBarArt* GetArtProvider() const; | |
653 | ||
654 | bool SetFont(const wxFont& font); | |
655 | ||
656 | ||
657 | wxAuiToolBarItem* AddTool(int tool_id, | |
658 | const wxString& label, | |
659 | const wxBitmap& bitmap, | |
660 | const wxString& short_help_string = wxEmptyString, | |
661 | wxItemKind kind = wxITEM_NORMAL); | |
662 | ||
663 | wxAuiToolBarItem* AddTool(int tool_id, | |
664 | const wxString& label, | |
665 | const wxBitmap& bitmap, | |
666 | const wxBitmap& disabled_bitmap, | |
667 | wxItemKind kind, | |
668 | const wxString& short_help_string, | |
669 | const wxString& long_help_string, | |
670 | wxObject* client_data); | |
671 | ||
672 | wxAuiToolBarItem* AddTool(int tool_id, | |
673 | const wxBitmap& bitmap, | |
674 | const wxBitmap& disabled_bitmap, | |
675 | bool toggle = false, | |
676 | wxObject* client_data = NULL, | |
677 | const wxString& short_help_string = wxEmptyString, | |
678 | const wxString& long_help_string = wxEmptyString); | |
679 | ||
680 | wxAuiToolBarItem* AddLabel(int tool_id, | |
681 | const wxString& label = wxEmptyString, | |
682 | const int width = -1); | |
683 | wxAuiToolBarItem* AddControl(wxControl* control, | |
684 | const wxString& label = wxEmptyString); | |
685 | wxAuiToolBarItem* AddSeparator(); | |
686 | wxAuiToolBarItem* AddSpacer(int pixels); | |
687 | wxAuiToolBarItem* AddStretchSpacer(int proportion = 1); | |
688 | ||
689 | bool Realize(); | |
690 | ||
691 | wxControl* FindControl(int window_id); | |
692 | wxAuiToolBarItem* FindToolByPosition(wxCoord x, wxCoord y) const; | |
693 | wxAuiToolBarItem* FindToolByIndex(int idx) const; | |
694 | wxAuiToolBarItem* FindTool(int tool_id) const; | |
695 | ||
696 | void ClearTools(); | |
697 | void Clear(); | |
698 | bool DeleteTool(int tool_id); | |
699 | bool DeleteByIndex(int tool_id); | |
700 | ||
701 | size_t GetToolCount() const; | |
702 | int GetToolPos(int tool_id) const; | |
703 | int GetToolIndex(int tool_id) const; | |
704 | bool GetToolFits(int tool_id) const; | |
705 | wxRect GetToolRect(int tool_id) const; | |
706 | bool GetToolFitsByIndex(int tool_id) const; | |
707 | bool GetToolBarFits() const; | |
708 | ||
709 | void SetMargins(const wxSize& size); | |
710 | void SetMargins(int x, int y); | |
711 | void SetMargins(int left, int right, int top, int bottom); | |
712 | ||
713 | void SetToolBitmapSize(const wxSize& size); | |
714 | wxSize GetToolBitmapSize() const; | |
715 | ||
716 | bool GetOverflowVisible() const; | |
717 | void SetOverflowVisible(bool visible); | |
718 | ||
719 | bool GetGripperVisible() const; | |
720 | void SetGripperVisible(bool visible); | |
721 | ||
722 | void ToggleTool(int tool_id, bool state); | |
723 | bool GetToolToggled(int tool_id) const; | |
724 | ||
725 | void EnableTool(int tool_id, bool state); | |
726 | bool GetToolEnabled(int tool_id) const; | |
727 | ||
72ae0b51 VZ |
728 | /** |
729 | Set whether the specified toolbar item has a drop down button. | |
730 | ||
731 | This is only valid for wxITEM_NORMAL tools. | |
732 | ||
733 | @see wxAuiToolBarItem::SetHasDropDown() | |
734 | */ | |
f8ecadbf | 735 | void SetToolDropDown(int tool_id, bool dropdown); |
72ae0b51 VZ |
736 | |
737 | /** | |
738 | Returns whether the specified toolbar item has an associated drop down | |
739 | button. | |
740 | ||
741 | @see wxAuiToolBarItem::HasDropDown() | |
742 | */ | |
f8ecadbf VZ |
743 | bool GetToolDropDown(int tool_id) const; |
744 | ||
745 | void SetToolBorderPadding(int padding); | |
746 | int GetToolBorderPadding() const; | |
747 | ||
748 | void SetToolTextOrientation(int orientation); | |
749 | int GetToolTextOrientation() const; | |
750 | ||
751 | void SetToolPacking(int packing); | |
752 | int GetToolPacking() const; | |
753 | ||
754 | void SetToolProportion(int tool_id, int proportion); | |
755 | int GetToolProportion(int tool_id) const; | |
756 | ||
757 | void SetToolSeparation(int separation); | |
758 | int GetToolSeparation() const; | |
759 | ||
760 | void SetToolSticky(int tool_id, bool sticky); | |
761 | bool GetToolSticky(int tool_id) const; | |
762 | ||
763 | wxString GetToolLabel(int tool_id) const; | |
764 | void SetToolLabel(int tool_id, const wxString& label); | |
765 | ||
766 | wxBitmap GetToolBitmap(int tool_id) const; | |
767 | void SetToolBitmap(int tool_id, const wxBitmap& bitmap); | |
768 | ||
769 | wxString GetToolShortHelp(int tool_id) const; | |
770 | void SetToolShortHelp(int tool_id, const wxString& help_string); | |
771 | ||
772 | wxString GetToolLongHelp(int tool_id) const; | |
773 | void SetToolLongHelp(int tool_id, const wxString& help_string); | |
774 | ||
775 | void SetCustomOverflowItems(const wxAuiToolBarItemArray& prepend, | |
776 | const wxAuiToolBarItemArray& append); | |
777 | ||
778 | /** get size of hint rectangle for a particular dock location */ | |
779 | wxSize GetHintSize(int dock_direction) const; | |
780 | bool IsPaneValid(const wxAuiPaneInfo& pane) const; | |
781 | }; | |
782 |