]> git.saurik.com Git - wxWidgets.git/blame - include/wx/aui/auibar.h
Use event tables instead of Connect() in wxInfoBarGeneric.
[wxWidgets.git] / include / wx / aui / auibar.h
CommitLineData
1154f91b
BW
1///////////////////////////////////////////////////////////////////////////////
2// Name: wx/aui/toolbar.h
3// Purpose: wxaui: wx advanced user interface - docking window manager
4// Author: Benjamin I. Williams
5// Modified by:
6// Created: 2008-08-04
054f177b 7// RCS-ID: $Id$
1154f91b
BW
8// Copyright: (C) Copyright 2005, Kirix Corporation, All Rights Reserved.
9// Licence: wxWindows Library Licence, Version 3.1
10///////////////////////////////////////////////////////////////////////////////
11
1154f91b
BW
12#ifndef _WX_AUIBAR_H_
13#define _WX_AUIBAR_H_
14
1154f91b
BW
15#include "wx/defs.h"
16
17#if wxUSE_AUI
18
9da38912 19#include "wx/control.h"
8e190381
FM
20#include "wx/sizer.h"
21#include "wx/pen.h"
22
23//class WXDLLIMPEXP_FWD_CORE wxSizerItem;
1154f91b
BW
24
25enum wxAuiToolBarStyle
26{
27 wxAUI_TB_TEXT = 1 << 0,
28 wxAUI_TB_NO_TOOLTIPS = 1 << 1,
29 wxAUI_TB_NO_AUTORESIZE = 1 << 2,
30 wxAUI_TB_GRIPPER = 1 << 3,
31 wxAUI_TB_OVERFLOW = 1 << 4,
32 wxAUI_TB_VERTICAL = 1 << 5,
9578058d
BW
33 wxAUI_TB_HORZ_LAYOUT = 1 << 6,
34 wxAUI_TB_HORZ_TEXT = (wxAUI_TB_HORZ_LAYOUT | wxAUI_TB_TEXT),
1154f91b
BW
35 wxAUI_TB_DEFAULT_STYLE = 0
36};
37
38enum wxAuiToolBarArtSetting
39{
40 wxAUI_TBART_SEPARATOR_SIZE = 0,
41 wxAUI_TBART_GRIPPER_SIZE = 1,
42 wxAUI_TBART_OVERFLOW_SIZE = 2
43};
44
45enum wxAuiToolBarToolTextOrientation
46{
47 wxAUI_TBTOOL_TEXT_LEFT = 0, // unused/unimplemented
48 wxAUI_TBTOOL_TEXT_RIGHT = 1,
49 wxAUI_TBTOOL_TEXT_TOP = 2, // unused/unimplemented
50 wxAUI_TBTOOL_TEXT_BOTTOM = 3
51};
52
53
54// aui toolbar event class
55
56class WXDLLIMPEXP_AUI wxAuiToolBarEvent : public wxNotifyEvent
57{
58public:
59 wxAuiToolBarEvent(wxEventType command_type = wxEVT_NULL,
60 int win_id = 0)
61 : wxNotifyEvent(command_type, win_id)
62 {
63 is_dropdown_clicked = false;
64 click_pt = wxPoint(-1, -1);
65 rect = wxRect(-1,-1, 0, 0);
66 tool_id = -1;
67 }
68#ifndef SWIG
69 wxAuiToolBarEvent(const wxAuiToolBarEvent& c) : wxNotifyEvent(c)
70 {
71 is_dropdown_clicked = c.is_dropdown_clicked;
72 click_pt = c.click_pt;
73 rect = c.rect;
74 tool_id = c.tool_id;
75 }
76#endif
77 wxEvent *Clone() const { return new wxAuiToolBarEvent(*this); }
78
79 bool IsDropDownClicked() const { return is_dropdown_clicked; }
80 void SetDropDownClicked(bool c) { is_dropdown_clicked = c; }
9da38912 81
1154f91b
BW
82 wxPoint GetClickPoint() const { return click_pt; }
83 void SetClickPoint(const wxPoint& p) { click_pt = p; }
9da38912 84
1154f91b
BW
85 wxRect GetItemRect() const { return rect; }
86 void SetItemRect(const wxRect& r) { rect = r; }
9da38912 87
1154f91b
BW
88 int GetToolId() const { return tool_id; }
89 void SetToolId(int id) { tool_id = id; }
9da38912 90
e42f2c16
BW
91private:
92
1154f91b
BW
93 bool is_dropdown_clicked;
94 wxPoint click_pt;
95 wxRect rect;
96 int tool_id;
9da38912 97
1154f91b
BW
98private:
99 DECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxAuiToolBarEvent)
1154f91b
BW
100};
101
102
103class WXDLLIMPEXP_AUI wxAuiToolBarItem
104{
e42f2c16 105 friend class wxAuiToolBar;
8e190381 106
1154f91b
BW
107public:
108
109 wxAuiToolBarItem()
110 {
111 window = NULL;
112 sizer_item = NULL;
e42f2c16 113 spacer_pixels = 0;
1154f91b
BW
114 id = 0;
115 kind = wxITEM_NORMAL;
116 state = 0; // normal, enabled
117 proportion = 0;
118 active = true;
119 dropdown = true;
120 sticky = true;
121 user_data = 0;
0eefa659 122 alignment = wxALIGN_CENTER;
1154f91b 123 }
9da38912 124
1154f91b
BW
125 wxAuiToolBarItem(const wxAuiToolBarItem& c)
126 {
127 Assign(c);
128 }
9da38912 129
1154f91b
BW
130 wxAuiToolBarItem& operator=(const wxAuiToolBarItem& c)
131 {
132 Assign(c);
133 return *this;
134 }
9da38912 135
1154f91b
BW
136 void Assign(const wxAuiToolBarItem& c)
137 {
138 window = c.window;
139 label = c.label;
140 bitmap = c.bitmap;
141 disabled_bitmap = c.disabled_bitmap;
142 hover_bitmap = c.hover_bitmap;
143 short_help = c.short_help;
144 long_help = c.long_help;
145 sizer_item = c.sizer_item;
146 min_size = c.min_size;
e42f2c16 147 spacer_pixels = c.spacer_pixels;
1154f91b
BW
148 id = c.id;
149 kind = c.kind;
150 state = c.state;
151 proportion = c.proportion;
152 active = c.active;
153 dropdown = c.dropdown;
154 sticky = c.sticky;
155 user_data = c.user_data;
0eefa659 156 alignment = c.alignment;
1154f91b 157 }
8e190381
FM
158
159
0766faa3 160 void SetWindow(wxWindow* w) { window = w; }
e42f2c16 161 wxWindow* GetWindow() { return window; }
8e190381 162
0766faa3 163 void SetId(int new_id) { id = new_id; }
e42f2c16 164 int GetId() const { return id; }
8e190381 165
0766faa3 166 void SetKind(int new_kind) { kind = new_kind; }
e42f2c16 167 int GetKind() const { return kind; }
8e190381 168
0766faa3 169 void SetState(int new_state) { state = new_state; }
e42f2c16 170 int GetState() const { return state; }
8e190381 171
0766faa3 172 void SetSizerItem(wxSizerItem* s) { sizer_item = s; }
e42f2c16 173 wxSizerItem* GetSizerItem() const { return sizer_item; }
8e190381 174
e42f2c16
BW
175 void SetLabel(const wxString& s) { label = s; }
176 const wxString& GetLabel() const { return label; }
8e190381 177
e42f2c16
BW
178 void SetBitmap(const wxBitmap& bmp) { bitmap = bmp; }
179 const wxBitmap& GetBitmap() const { return bitmap; }
8e190381 180
e42f2c16
BW
181 void SetDisabledBitmap(const wxBitmap& bmp) { disabled_bitmap = bmp; }
182 const wxBitmap& GetDisabledBitmap() const { return disabled_bitmap; }
8e190381 183
e42f2c16
BW
184 void SetHoverBitmap(const wxBitmap& bmp) { hover_bitmap = bmp; }
185 const wxBitmap& GetHoverBitmap() const { return hover_bitmap; }
8e190381 186
e42f2c16
BW
187 void SetShortHelp(const wxString& s) { short_help = s; }
188 const wxString& GetShortHelp() const { return short_help; }
8e190381 189
e42f2c16
BW
190 void SetLongHelp(const wxString& s) { long_help = s; }
191 const wxString& GetLongHelp() const { return long_help; }
8e190381 192
e42f2c16
BW
193 void SetMinSize(const wxSize& s) { min_size = s; }
194 const wxSize& GetMinSize() const { return min_size; }
8e190381 195
e42f2c16
BW
196 void SetSpacerPixels(int s) { spacer_pixels = s; }
197 int GetSpacerPixels() const { return spacer_pixels; }
8e190381 198
e42f2c16
BW
199 void SetProportion(int p) { proportion = p; }
200 int GetProportion() const { return proportion; }
8e190381 201
e42f2c16
BW
202 void SetActive(bool b) { active = b; }
203 bool IsActive() const { return active; }
8e190381 204
e42f2c16
BW
205 void SetHasDropDown(bool b) { dropdown = b; }
206 bool HasDropDown() const { return dropdown; }
8e190381 207
e42f2c16
BW
208 void SetSticky(bool b) { sticky = b; }
209 bool IsSticky() const { return sticky; }
8e190381 210
e42f2c16
BW
211 void SetUserData(long l) { user_data = l; }
212 long GetUserData() const { return user_data; }
9da38912 213
0eefa659
BW
214 void SetAlignment(int l) { alignment = l; }
215 int GetAlignment() const { return alignment; }
216
e42f2c16 217private:
9da38912 218
1154f91b
BW
219 wxWindow* window; // item's associated window
220 wxString label; // label displayed on the item
221 wxBitmap bitmap; // item's bitmap
222 wxBitmap disabled_bitmap; // item's disabled bitmap
223 wxBitmap hover_bitmap; // item's hover bitmap
224 wxString short_help; // short help (for tooltip)
225 wxString long_help; // long help (for status bar)
226 wxSizerItem* sizer_item; // sizer item
227 wxSize min_size; // item's minimum size
e42f2c16 228 int spacer_pixels; // size of a spacer
1154f91b
BW
229 int id; // item's id
230 int kind; // item's kind
231 int state; // state
232 int proportion; // proportion
233 bool active; // true if the item is currently active
234 bool dropdown; // true if the item has a dropdown button
235 bool sticky; // overrides button states if true (always active)
236 long user_data; // user-specified data
0eefa659 237 int alignment; // sizer alignment flag, defaults to wxCENTER, may be wxEXPAND or any other
1154f91b
BW
238};
239
240#ifndef SWIG
241WX_DECLARE_USER_EXPORTED_OBJARRAY(wxAuiToolBarItem, wxAuiToolBarItemArray, WXDLLIMPEXP_AUI);
242#endif
243
244
245
246
247// tab art class
248
249class WXDLLIMPEXP_AUI wxAuiToolBarArt
250{
251public:
252
253 wxAuiToolBarArt() { }
254 virtual ~wxAuiToolBarArt() { }
9da38912 255
1154f91b 256 virtual wxAuiToolBarArt* Clone() = 0;
9da38912 257 virtual void SetFlags(unsigned int flags) = 0;
8bc10f32 258 virtual unsigned int GetFlags() = 0;
1154f91b 259 virtual void SetFont(const wxFont& font) = 0;
8bc10f32 260 virtual wxFont GetFont() = 0;
1154f91b 261 virtual void SetTextOrientation(int orientation) = 0;
8bc10f32 262 virtual int GetTextOrientation() = 0;
1154f91b
BW
263
264 virtual void DrawBackground(
265 wxDC& dc,
266 wxWindow* wnd,
9da38912
VZ
267 const wxRect& rect) = 0;
268
1154f91b
BW
269 virtual void DrawLabel(
270 wxDC& dc,
271 wxWindow* wnd,
272 const wxAuiToolBarItem& item,
273 const wxRect& rect) = 0;
9da38912 274
1154f91b
BW
275 virtual void DrawButton(
276 wxDC& dc,
277 wxWindow* wnd,
278 const wxAuiToolBarItem& item,
279 const wxRect& rect) = 0;
9da38912 280
1154f91b
BW
281 virtual void DrawDropDownButton(
282 wxDC& dc,
283 wxWindow* wnd,
284 const wxAuiToolBarItem& item,
285 const wxRect& rect) = 0;
9da38912 286
1154f91b
BW
287 virtual void DrawControlLabel(
288 wxDC& dc,
289 wxWindow* wnd,
290 const wxAuiToolBarItem& item,
291 const wxRect& rect) = 0;
9da38912 292
1154f91b
BW
293 virtual void DrawSeparator(
294 wxDC& dc,
295 wxWindow* wnd,
296 const wxRect& rect) = 0;
9da38912 297
1154f91b
BW
298 virtual void DrawGripper(
299 wxDC& dc,
300 wxWindow* wnd,
301 const wxRect& rect) = 0;
302
303 virtual void DrawOverflowButton(
304 wxDC& dc,
305 wxWindow* wnd,
306 const wxRect& rect,
307 int state) = 0;
9da38912 308
1154f91b
BW
309 virtual wxSize GetLabelSize(
310 wxDC& dc,
311 wxWindow* wnd,
312 const wxAuiToolBarItem& item) = 0;
9da38912 313
1154f91b
BW
314 virtual wxSize GetToolSize(
315 wxDC& dc,
316 wxWindow* wnd,
317 const wxAuiToolBarItem& item) = 0;
9da38912 318
1154f91b
BW
319 virtual int GetElementSize(int element_id) = 0;
320 virtual void SetElementSize(int element_id, int size) = 0;
9da38912 321
1154f91b
BW
322 virtual int ShowDropDown(
323 wxWindow* wnd,
324 const wxAuiToolBarItemArray& items) = 0;
325};
326
327
328
329class WXDLLIMPEXP_AUI wxAuiDefaultToolBarArt : public wxAuiToolBarArt
330{
331
332public:
333
334 wxAuiDefaultToolBarArt();
335 virtual ~wxAuiDefaultToolBarArt();
9da38912 336
1154f91b
BW
337 virtual wxAuiToolBarArt* Clone();
338 virtual void SetFlags(unsigned int flags);
8bc10f32 339 virtual unsigned int GetFlags();
1154f91b 340 virtual void SetFont(const wxFont& font);
8bc10f32 341 virtual wxFont GetFont();
1154f91b 342 virtual void SetTextOrientation(int orientation);
8bc10f32 343 virtual int GetTextOrientation();
1154f91b
BW
344
345 virtual void DrawBackground(
346 wxDC& dc,
347 wxWindow* wnd,
9da38912
VZ
348 const wxRect& rect);
349
1154f91b
BW
350 virtual void DrawLabel(
351 wxDC& dc,
352 wxWindow* wnd,
353 const wxAuiToolBarItem& item,
354 const wxRect& rect);
9da38912 355
1154f91b
BW
356 virtual void DrawButton(
357 wxDC& dc,
358 wxWindow* wnd,
359 const wxAuiToolBarItem& item,
360 const wxRect& rect);
9da38912 361
1154f91b
BW
362 virtual void DrawDropDownButton(
363 wxDC& dc,
364 wxWindow* wnd,
365 const wxAuiToolBarItem& item,
366 const wxRect& rect);
9da38912 367
1154f91b
BW
368 virtual void DrawControlLabel(
369 wxDC& dc,
370 wxWindow* wnd,
371 const wxAuiToolBarItem& item,
372 const wxRect& rect);
9da38912 373
1154f91b
BW
374 virtual void DrawSeparator(
375 wxDC& dc,
376 wxWindow* wnd,
377 const wxRect& rect);
9da38912 378
1154f91b
BW
379 virtual void DrawGripper(
380 wxDC& dc,
381 wxWindow* wnd,
382 const wxRect& rect);
9da38912 383
1154f91b
BW
384 virtual void DrawOverflowButton(
385 wxDC& dc,
386 wxWindow* wnd,
387 const wxRect& rect,
388 int state);
9da38912 389
1154f91b
BW
390 virtual wxSize GetLabelSize(
391 wxDC& dc,
392 wxWindow* wnd,
393 const wxAuiToolBarItem& item);
9da38912 394
1154f91b
BW
395 virtual wxSize GetToolSize(
396 wxDC& dc,
397 wxWindow* wnd,
398 const wxAuiToolBarItem& item);
9da38912 399
1154f91b
BW
400 virtual int GetElementSize(int element);
401 virtual void SetElementSize(int element_id, int size);
402
403 virtual int ShowDropDown(wxWindow* wnd,
404 const wxAuiToolBarItemArray& items);
405
406protected:
407
408 wxBitmap m_button_dropdown_bmp;
409 wxBitmap m_disabled_button_dropdown_bmp;
410 wxBitmap m_overflow_bmp;
411 wxBitmap m_disabled_overflow_bmp;
412 wxColour m_base_colour;
413 wxColour m_highlight_colour;
414 wxFont m_font;
415 unsigned int m_flags;
416 int m_text_orientation;
9da38912 417
1154f91b
BW
418 wxPen m_gripper_pen1;
419 wxPen m_gripper_pen2;
420 wxPen m_gripper_pen3;
9da38912 421
1154f91b
BW
422 int m_separator_size;
423 int m_gripper_size;
424 int m_overflow_size;
425};
426
427
428
429
430class WXDLLIMPEXP_AUI wxAuiToolBar : public wxControl
431{
432public:
433
434 wxAuiToolBar(wxWindow* parent,
435 wxWindowID id = -1,
436 const wxPoint& position = wxDefaultPosition,
437 const wxSize& size = wxDefaultSize,
438 long style = wxAUI_TB_DEFAULT_STYLE);
7bce8439 439 virtual ~wxAuiToolBar();
9da38912 440
1154f91b 441 void SetWindowStyleFlag(long style);
e7b8af65 442 long GetWindowStyleFlag() const;
9da38912 443
1154f91b
BW
444 void SetArtProvider(wxAuiToolBarArt* art);
445 wxAuiToolBarArt* GetArtProvider() const;
446
447 bool SetFont(const wxFont& font);
9da38912 448
1154f91b 449
7bce8439 450 wxAuiToolBarItem* AddTool(int tool_id,
1154f91b
BW
451 const wxString& label,
452 const wxBitmap& bitmap,
453 const wxString& short_help_string = wxEmptyString,
454 wxItemKind kind = wxITEM_NORMAL);
9da38912 455
7bce8439 456 wxAuiToolBarItem* AddTool(int tool_id,
1154f91b
BW
457 const wxString& label,
458 const wxBitmap& bitmap,
459 const wxBitmap& disabled_bitmap,
460 wxItemKind kind,
461 const wxString& short_help_string,
462 const wxString& long_help_string,
463 wxObject* client_data);
9da38912 464
7bce8439 465 wxAuiToolBarItem* AddTool(int tool_id,
1154f91b
BW
466 const wxBitmap& bitmap,
467 const wxBitmap& disabled_bitmap,
468 bool toggle = false,
469 wxObject* client_data = NULL,
470 const wxString& short_help_string = wxEmptyString,
471 const wxString& long_help_string = wxEmptyString)
472 {
7bce8439 473 return AddTool(tool_id,
1154f91b
BW
474 wxEmptyString,
475 bitmap,
476 disabled_bitmap,
477 toggle ? wxITEM_CHECK : wxITEM_NORMAL,
478 short_help_string,
479 long_help_string,
480 client_data);
481 }
9da38912 482
7bce8439 483 wxAuiToolBarItem* AddLabel(int tool_id,
1154f91b
BW
484 const wxString& label = wxEmptyString,
485 const int width = -1);
7bce8439 486 wxAuiToolBarItem* AddControl(wxControl* control,
1154f91b 487 const wxString& label = wxEmptyString);
7bce8439
BW
488 wxAuiToolBarItem* AddSeparator();
489 wxAuiToolBarItem* AddSpacer(int pixels);
490 wxAuiToolBarItem* AddStretchSpacer(int proportion = 1);
9da38912 491
1154f91b
BW
492 bool Realize();
493
494 wxControl* FindControl(int window_id);
495 wxAuiToolBarItem* FindToolByPosition(wxCoord x, wxCoord y) const;
496 wxAuiToolBarItem* FindToolByIndex(int idx) const;
497 wxAuiToolBarItem* FindTool(int tool_id) const;
9da38912 498
1154f91b
BW
499 void ClearTools() { Clear() ; }
500 void Clear();
501 bool DeleteTool(int tool_id);
502 bool DeleteByIndex(int tool_id);
9da38912 503
1154f91b
BW
504 size_t GetToolCount() const;
505 int GetToolPos(int tool_id) const { return GetToolIndex(tool_id); }
506 int GetToolIndex(int tool_id) const;
507 bool GetToolFits(int tool_id) const;
508 wxRect GetToolRect(int tool_id) const;
9da38912 509 bool GetToolFitsByIndex(int tool_id) const;
1154f91b 510 bool GetToolBarFits() const;
9da38912 511
1154f91b
BW
512 void SetMargins(const wxSize& size) { SetMargins(size.x, size.x, size.y, size.y); }
513 void SetMargins(int x, int y) { SetMargins(x, x, y, y); }
514 void SetMargins(int left, int right, int top, int bottom);
9da38912 515
1154f91b
BW
516 void SetToolBitmapSize(const wxSize& size);
517 wxSize GetToolBitmapSize() const;
518
519 bool GetOverflowVisible() const;
520 void SetOverflowVisible(bool visible);
9da38912 521
1154f91b
BW
522 bool GetGripperVisible() const;
523 void SetGripperVisible(bool visible);
9da38912 524
1154f91b
BW
525 void ToggleTool(int tool_id, bool state);
526 bool GetToolToggled(int tool_id) const;
9da38912 527
1154f91b
BW
528 void EnableTool(int tool_id, bool state);
529 bool GetToolEnabled(int tool_id) const;
9da38912 530
1154f91b
BW
531 void SetToolDropDown(int tool_id, bool dropdown);
532 bool GetToolDropDown(int tool_id) const;
533
534 void SetToolBorderPadding(int padding);
535 int GetToolBorderPadding() const;
9da38912 536
1154f91b
BW
537 void SetToolTextOrientation(int orientation);
538 int GetToolTextOrientation() const;
9da38912 539
1154f91b
BW
540 void SetToolPacking(int packing);
541 int GetToolPacking() const;
9da38912 542
1154f91b
BW
543 void SetToolProportion(int tool_id, int proportion);
544 int GetToolProportion(int tool_id) const;
9da38912 545
1154f91b
BW
546 void SetToolSeparation(int separation);
547 int GetToolSeparation() const;
9da38912 548
1154f91b
BW
549 void SetToolSticky(int tool_id, bool sticky);
550 bool GetToolSticky(int tool_id) const;
9da38912 551
1154f91b
BW
552 wxString GetToolLabel(int tool_id) const;
553 void SetToolLabel(int tool_id, const wxString& label);
9da38912 554
1154f91b
BW
555 wxBitmap GetToolBitmap(int tool_id) const;
556 void SetToolBitmap(int tool_id, const wxBitmap& bitmap);
9da38912 557
1154f91b
BW
558 wxString GetToolShortHelp(int tool_id) const;
559 void SetToolShortHelp(int tool_id, const wxString& help_string);
9da38912 560
1154f91b
BW
561 wxString GetToolLongHelp(int tool_id) const;
562 void SetToolLongHelp(int tool_id, const wxString& help_string);
9da38912 563
1154f91b
BW
564 void SetCustomOverflowItems(const wxAuiToolBarItemArray& prepend,
565 const wxAuiToolBarItemArray& append);
9da38912 566
1154f91b
BW
567protected:
568
569 virtual void OnCustomRender(wxDC& WXUNUSED(dc),
570 const wxAuiToolBarItem& WXUNUSED(item),
571 const wxRect& WXUNUSED(rect)) { }
572
573protected:
574
575 void DoIdleUpdate();
576 void SetOrientation(int orientation);
577 void SetHoverItem(wxAuiToolBarItem* item);
578 void SetPressedItem(wxAuiToolBarItem* item);
579 void RefreshOverflowState();
9da38912 580
1154f91b
BW
581 int GetOverflowState() const;
582 wxRect GetOverflowRect() const;
583 wxSize GetLabelSize(const wxString& label);
584 wxAuiToolBarItem* FindToolByPositionWithPacking(wxCoord x, wxCoord y) const;
585
586 void DoSetSize(int x,
587 int y,
588 int width,
589 int height,
590 int sizeFlags = wxSIZE_AUTO);
9da38912 591
1154f91b
BW
592protected: // handlers
593
594 void OnSize(wxSizeEvent& evt);
595 void OnIdle(wxIdleEvent& evt);
596 void OnPaint(wxPaintEvent& evt);
597 void OnEraseBackground(wxEraseEvent& evt);
598 void OnLeftDown(wxMouseEvent& evt);
599 void OnLeftUp(wxMouseEvent& evt);
600 void OnRightDown(wxMouseEvent& evt);
601 void OnRightUp(wxMouseEvent& evt);
602 void OnMiddleDown(wxMouseEvent& evt);
603 void OnMiddleUp(wxMouseEvent& evt);
604 void OnMotion(wxMouseEvent& evt);
605 void OnLeaveWindow(wxMouseEvent& evt);
606 void OnSetCursor(wxSetCursorEvent& evt);
9da38912 607
1154f91b
BW
608protected:
609
610 wxAuiToolBarItemArray m_items; // array of toolbar items
611 wxAuiToolBarArt* m_art; // art provider
612 wxBoxSizer* m_sizer; // main sizer for toolbar
613 wxAuiToolBarItem* m_action_item; // item that's being acted upon (pressed)
614 wxAuiToolBarItem* m_tip_item; // item that has its tooltip shown
615 wxBitmap m_bitmap; // double-buffer bitmap
616 wxSizerItem* m_gripper_sizer_item;
617 wxSizerItem* m_overflow_sizer_item;
618 wxSize m_absolute_min_size;
619 wxPoint m_action_pos; // position of left-mouse down
620 wxAuiToolBarItemArray m_custom_overflow_prepend;
621 wxAuiToolBarItemArray m_custom_overflow_append;
9da38912 622
1154f91b
BW
623 int m_button_width;
624 int m_button_height;
625 int m_sizer_element_count;
626 int m_left_padding;
627 int m_right_padding;
628 int m_top_padding;
629 int m_bottom_padding;
630 int m_tool_packing;
631 int m_tool_border_padding;
632 int m_tool_text_orientation;
633 int m_overflow_state;
634 bool m_dragging;
635 bool m_gripper_visible;
636 bool m_overflow_visible;
637 long m_style;
9da38912 638
1154f91b
BW
639 DECLARE_EVENT_TABLE()
640 DECLARE_CLASS(wxAuiToolBar)
641};
642
643
644
645
646// wx event machinery
647
648#ifndef SWIG
649
9b11752c
VZ
650wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_AUI, wxEVT_COMMAND_AUITOOLBAR_TOOL_DROPDOWN, wxAuiToolBarEvent );
651wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_AUI, wxEVT_COMMAND_AUITOOLBAR_OVERFLOW_CLICK, wxAuiToolBarEvent );
652wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_AUI, wxEVT_COMMAND_AUITOOLBAR_RIGHT_CLICK, wxAuiToolBarEvent );
653wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_AUI, wxEVT_COMMAND_AUITOOLBAR_MIDDLE_CLICK, wxAuiToolBarEvent );
654wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_AUI, wxEVT_COMMAND_AUITOOLBAR_BEGIN_DRAG, wxAuiToolBarEvent );
1154f91b
BW
655
656typedef void (wxEvtHandler::*wxAuiToolBarEventFunction)(wxAuiToolBarEvent&);
657
658#define wxAuiToolBarEventHandler(func) \
3c778901 659 wxEVENT_HANDLER_CAST(wxAuiToolBarEventFunction, func)
9da38912 660
1154f91b
BW
661#define EVT_AUITOOLBAR_TOOL_DROPDOWN(winid, fn) \
662 wx__DECLARE_EVT1(wxEVT_COMMAND_AUITOOLBAR_TOOL_DROPDOWN, winid, wxAuiToolBarEventHandler(fn))
663#define EVT_AUITOOLBAR_OVERFLOW_CLICK(winid, fn) \
664 wx__DECLARE_EVT1(wxEVT_COMMAND_AUITOOLBAR_OVERFLOW_CLICK, winid, wxAuiToolBarEventHandler(fn))
665#define EVT_AUITOOLBAR_RIGHT_CLICK(winid, fn) \
666 wx__DECLARE_EVT1(wxEVT_COMMAND_AUITOOLBAR_RIGHT_CLICK, winid, wxAuiToolBarEventHandler(fn))
667#define EVT_AUITOOLBAR_MIDDLE_CLICK(winid, fn) \
668 wx__DECLARE_EVT1(wxEVT_COMMAND_AUITOOLBAR_MIDDLE_CLICK, winid, wxAuiToolBarEventHandler(fn))
669#define EVT_AUITOOLBAR_BEGIN_DRAG(winid, fn) \
670 wx__DECLARE_EVT1(wxEVT_COMMAND_AUITOOLBAR_BEGIN_DRAG, winid, wxAuiToolBarEventHandler(fn))
671
672#else
673
674// wxpython/swig event work
675%constant wxEventType wxEVT_COMMAND_AUITOOLBAR_TOOL_DROPDOWN;
676%constant wxEventType wxEVT_COMMAND_AUITOOLBAR_OVERFLOW_CLICK;
677%constant wxEventType wxEVT_COMMAND_AUITOOLBAR_RIGHT_CLICK;
678%constant wxEventType wxEVT_COMMAND_AUITOOLBAR_MIDDLE_CLICK;
679%constant wxEventType wxEVT_COMMAND_AUITOOLBAR_BEGIN_DRAG;
680
681%pythoncode {
682 EVT_AUITOOLBAR_TOOL_DROPDOWN = wx.PyEventBinder( wxEVT_COMMAND_AUITOOLBAR_TOOL_DROPDOWN, 1 )
683 EVT_AUITOOLBAR_OVERFLOW_CLICK = wx.PyEventBinder( wxEVT_COMMAND_AUITOOLBAR_OVERFLOW_CLICK, 1 )
684 EVT_AUITOOLBAR_RIGHT_CLICK = wx.PyEventBinder( wxEVT_COMMAND_AUITOOLBAR_RIGHT_CLICK, 1 )
685 EVT_AUITOOLBAR_MIDDLE_CLICK = wx.PyEventBinder( wxEVT_COMMAND_AUITOOLBAR_MIDDLE_CLICK, 1 )
686 EVT_AUITOOLBAR_BEGIN_DRAG = wx.PyEventBinder( wxEVT_COMMAND_AUITOOLBAR_BEGIN_DRAG, 1 )
687}
688#endif // SWIG
689
690#endif // wxUSE_AUI
691#endif // _WX_AUIBAR_H_
692