# wxAuiToolBar Class Reference
[Window Docking (wxAUI)]

`#include </home/work/projects/wx/2.9/wx/interface/wx/aui/toolbar.h>`

Inheritance diagram for wxAuiToolBar:
[legend]

## Detailed Description

wxAuiToolBar is a dockable toolbar, part of the wxAUI class framework.

See also wxAUI Overview.

## Styles

This class supports the following styles:

- wxAUI_TB_TEXT:
- wxAUI_TB_NO_TOOLTIPS:
- wxAUI_TB_NO_AUTORESIZE:
- wxAUI_TB_GRIPPER:
- wxAUI_TB_OVERFLOW:
- wxAUI_TB_VERTICAL:
  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
- wxAUI_TB_HORZ_LAYOUT:
- wxAUI_TB_HORIZONTAL:
  analogous to wxAUI_TB_VERTICAL, but forces the toolbar to be horizontal
- wxAUI_TB_HORZ_TEXT:
  Equivalent to wxAUI_TB_HORZ_LAYOUT | wxAUI_TB_TEXT
- wxAUI_TB_DEFAULT_STYLE:
  The default is to have no styles

## Events emitted by this class

The following event handler macros redirect the events to member function handlers 'func' with prototypes like:

void handlerFuncName(wxAuiToolBarEvent& event)

Event macros for events emitted by this class:

- EVT_AUITOOLBAR_TOOL_DROPDOWN(id, func):
  Process a wxEVT_COMMAND_AUITOOLBAR_TOOL_DROPDOWN event
- EVT_AUITOOLBAR_OVERFLOW_CLICK(id, func):
  Process a wxEVT_COMMAND_AUITOOLBAR_OVERFLOW_CLICK event
- EVT_AUITOOLBAR_RIGHT_CLICK(id, func):
  Process a wxEVT_COMMAND_AUITOOLBAR_RIGHT_CLICK event
- EVT_AUITOOLBAR_MIDDLE_CLICK(id, func):
  Process a wxEVT_COMMAND_AUITOOLBAR_MIDDLE_CLICK event
- EVT_AUITOOLBAR_BEGIN_DRAG(id, func):
  Process a wxEVT_COMMAND_AUITOOLBAR_BEGIN_DRAG event

##

Library: wxAui
Category: Window Docking (wxAUI)

## Public Member Functions

| wxAuiToolBar (wxWindow *parent, wxWindowID id=-1, const wxPoint &position=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxAUI_TB_DEFAULT_STYLE)
virtual | ~wxAuiToolBar ()
void | SetWindowStyleFlag (long style)
| Sets the style of the window.
long | GetWindowStyleFlag () const
| Gets the window style that was passed to the constructor or Create() method.
void | SetArtProvider (wxAuiToolBarArt *art)
wxAuiToolBarArt * | GetArtProvider () const
bool | SetFont (const wxFont &font)
| Sets the font for this window.
wxAuiToolBarItem * | AddTool (int tool_id, const wxString &label, const wxBitmap &bitmap, const wxString &short_help_string=wxEmptyString, wxItemKind kind=wxITEM_NORMAL)
wxAuiToolBarItem * | AddTool (int tool_id, const wxString &label, const wxBitmap &bitmap, const wxBitmap &disabled_bitmap, wxItemKind kind, const wxString &short_help_string, const wxString &long_help_string, wxObject *client_data)
wxAuiToolBarItem * | AddTool (int tool_id, const wxBitmap &bitmap, const wxBitmap &disabled_bitmap, bool toggle=false, wxObject *client_data=NULL, const wxString &short_help_string=wxEmptyString, const wxString &long_help_string=wxEmptyString)
wxAuiToolBarItem * | AddLabel (int tool_id, const wxString &label=wxEmptyString, const int width=-1)
wxAuiToolBarItem * | AddControl (wxControl *control, const wxString &label=wxEmptyString)
wxAuiToolBarItem * | AddSeparator ()
wxAuiToolBarItem * | AddSpacer (int pixels)
wxAuiToolBarItem * | AddStretchSpacer (int proportion=1)
bool | Realize ()
wxControl * | FindControl (int window_id)
wxAuiToolBarItem * | FindToolByPosition (wxCoord x, wxCoord y) const
wxAuiToolBarItem * | FindToolByIndex (int idx) const
wxAuiToolBarItem * | FindTool (int tool_id) const
void | ClearTools ()
void | Clear ()
bool | DeleteTool (int tool_id)
bool | DeleteByIndex (int tool_id)
size_t | GetToolCount () const
int | GetToolPos (int tool_id) const
int | GetToolIndex (int tool_id) const
bool | GetToolFits (int tool_id) const
wxRect | GetToolRect (int tool_id) const
bool | GetToolFitsByIndex (int tool_id) const
bool | GetToolBarFits () const
void | SetMargins (const wxSize &size)
void | SetMargins (int x, int y)
void | SetMargins (int left, int right, int top, int bottom)
void | SetToolBitmapSize (const wxSize &size)
wxSize | GetToolBitmapSize () const
bool | GetOverflowVisible () const
void | SetOverflowVisible (bool visible)
bool | GetGripperVisible () const
void | SetGripperVisible (bool visible)
void | ToggleTool (int tool_id, bool state)
bool | GetToolToggled (int tool_id) const
void | EnableTool (int tool_id, bool state)
bool | GetToolEnabled (int tool_id) const
void | SetToolDropDown (int tool_id, bool dropdown)
bool | GetToolDropDown (int tool_id) const
void | SetToolBorderPadding (int padding)
int | GetToolBorderPadding () const
void | SetToolTextOrientation (int orientation)
int | GetToolTextOrientation () const
void | SetToolPacking (int packing)
int | GetToolPacking () const
void | SetToolProportion (int tool_id, int proportion)
int | GetToolProportion (int tool_id) const
void | SetToolSeparation (int separation)
int | GetToolSeparation () const
void | SetToolSticky (int tool_id, bool sticky)
bool | GetToolSticky (int tool_id) const
wxString | GetToolLabel (int tool_id) const
void | SetToolLabel (int tool_id, const wxString &label)
wxBitmap | GetToolBitmap (int tool_id) const
void | SetToolBitmap (int tool_id, const wxBitmap &bitmap)
wxString | GetToolShortHelp (int tool_id) const
void | SetToolShortHelp (int tool_id, const wxString &help_string)
wxString | GetToolLongHelp (int tool_id) const
void | SetToolLongHelp (int tool_id, const wxString &help_string)
void | SetCustomOverflowItems (const wxAuiToolBarItemArray &prepend, const wxAuiToolBarItemArray &append)
wxSize | GetHintSize (int dock_direction) const
| get size of hint rectangle for a particular dock location
bool | IsPaneValid (const wxAuiPaneInfo &pane) const

List of all members.

## Constructor & Destructor Documentation

wxAuiToolBar::wxAuiToolBar | ( | wxWindow * | parent,
|  | wxWindowID | id = `-1`,
|  | const wxPoint & | position = `wxDefaultPosition`,
|  | const wxSize & | size = `wxDefaultSize`,
|  | long | style = `wxAUI_TB_DEFAULT_STYLE` |
| ) |  |  |

virtual wxAuiToolBar::~wxAuiToolBar | ( |  | ) | `[virtual]`

## Member Function Documentation

wxAuiToolBarItem* wxAuiToolBar::AddControl | ( | wxControl * | control,
|  | const wxString & | label = `wxEmptyString` |
| ) |  |  |

wxAuiToolBarItem* wxAuiToolBar::AddLabel | ( | int | tool_id,
|  | const wxString & | label = `wxEmptyString`,
|  | const int | width = `-1` |
| ) |  |  |

wxAuiToolBarItem* wxAuiToolBar::AddSeparator | ( |  | ) |

wxAuiToolBarItem* wxAuiToolBar::AddSpacer | ( | int | pixels | ) |

wxAuiToolBarItem* wxAuiToolBar::AddStretchSpacer | ( | int | proportion = `1` | ) |

wxAuiToolBarItem* wxAuiToolBar::AddTool | ( | int | tool_id,
|  | const wxBitmap & | bitmap,
|  | const wxBitmap & | disabled_bitmap,
|  | bool | toggle = `false`,
|  | wxObject * | client_data = `NULL`,
|  | const wxString & | short_help_string = `wxEmptyString`,
|  | const wxString & | long_help_string = `wxEmptyString` |
| ) |  |  |

wxAuiToolBarItem* wxAuiToolBar::AddTool | ( | int | tool_id,
|  | const wxString & | label,
|  | const wxBitmap & | bitmap,
|  | const wxString & | short_help_string = `wxEmptyString`,
|  | wxItemKind | kind = `wxITEM_NORMAL` |
| ) |  |  |

wxAuiToolBarItem* wxAuiToolBar::AddTool | ( | int | tool_id,
|  | const wxString & | label,
|  | const wxBitmap & | bitmap,
|  | const wxBitmap & | disabled_bitmap,
|  | wxItemKind | kind,
|  | const wxString & | short_help_string,
|  | const wxString & | long_help_string,
|  | wxObject * | client_data |
| ) |  |  |

void wxAuiToolBar::Clear | ( |  | ) |

void wxAuiToolBar::ClearTools | ( |  | ) |

bool wxAuiToolBar::DeleteByIndex | ( | int | tool_id | ) |

bool wxAuiToolBar::DeleteTool | ( | int | tool_id | ) |

void wxAuiToolBar::EnableTool | ( | int | tool_id,
|  | bool | state |
| ) |  |  |

wxControl* wxAuiToolBar::FindControl | ( | int | window_id | ) |

wxAuiToolBarItem* wxAuiToolBar::FindTool | ( | int | tool_id | ) | const

wxAuiToolBarItem* wxAuiToolBar::FindToolByIndex | ( | int | idx | ) | const

wxAuiToolBarItem* wxAuiToolBar::FindToolByPosition | ( | wxCoord | x,
|  | wxCoord | y |
| ) |  |  | const

wxAuiToolBarArt* wxAuiToolBar::GetArtProvider | ( |  | ) | const

bool wxAuiToolBar::GetGripperVisible | ( |  | ) | const

wxSize wxAuiToolBar::GetHintSize | ( | int | dock_direction | ) | const

get size of hint rectangle for a particular dock location

bool wxAuiToolBar::GetOverflowVisible | ( |  | ) | const

bool wxAuiToolBar::GetToolBarFits | ( |  | ) | const

wxBitmap wxAuiToolBar::GetToolBitmap | ( | int | tool_id | ) | const

wxSize wxAuiToolBar::GetToolBitmapSize | ( |  | ) | const

int wxAuiToolBar::GetToolBorderPadding | ( |  | ) | const

size_t wxAuiToolBar::GetToolCount | ( |  | ) | const

bool wxAuiToolBar::GetToolDropDown | ( | int | tool_id | ) | const

bool wxAuiToolBar::GetToolEnabled | ( | int | tool_id | ) | const

bool wxAuiToolBar::GetToolFits | ( | int | tool_id | ) | const

bool wxAuiToolBar::GetToolFitsByIndex | ( | int | tool_id | ) | const

int wxAuiToolBar::GetToolIndex | ( | int | tool_id | ) | const

wxString wxAuiToolBar::GetToolLabel | ( | int | tool_id | ) | const

wxString wxAuiToolBar::GetToolLongHelp | ( | int | tool_id | ) | const

int wxAuiToolBar::GetToolPacking | ( |  | ) | const

int wxAuiToolBar::GetToolPos | ( | int | tool_id | ) | const

int wxAuiToolBar::GetToolProportion | ( | int | tool_id | ) | const

wxRect wxAuiToolBar::GetToolRect | ( | int | tool_id | ) | const

int wxAuiToolBar::GetToolSeparation | ( |  | ) | const

wxString wxAuiToolBar::GetToolShortHelp | ( | int | tool_id | ) | const

bool wxAuiToolBar::GetToolSticky | ( | int | tool_id | ) | const

int wxAuiToolBar::GetToolTextOrientation | ( |  | ) | const

bool wxAuiToolBar::GetToolToggled | ( | int | tool_id | ) | const

long wxAuiToolBar::GetWindowStyleFlag | ( |  | ) | const`[virtual]`

Gets the window style that was passed to the constructor or Create() method.

GetWindowStyle() is another name for the same function.

Reimplemented from wxWindow.

bool wxAuiToolBar::IsPaneValid | ( | const wxAuiPaneInfo & | pane | ) | const

bool wxAuiToolBar::Realize | ( |  | ) |

void wxAuiToolBar::SetArtProvider | ( | wxAuiToolBarArt * | art | ) |

void wxAuiToolBar::SetCustomOverflowItems | ( | const wxAuiToolBarItemArray & | prepend,
|  | const wxAuiToolBarItemArray & | append |
| ) |  |  |

bool wxAuiToolBar::SetFont | ( | const wxFont & | font | ) | `[virtual]`

Sets the font for this window.

This function should not be called for the parent window if you don't want its font to be inherited by its children, use SetOwnFont() instead in this case and see InheritAttributes() for more explanations.

Please notice that the given font is not automatically used for wxPaintDC objects associated with this window, you need to call wxDC::SetFont too. However this font is used by any standard controls for drawing their text as well as by GetTextExtent().

Parameters:

  | font | Font to associate with this window, pass wxNullFont to reset to the default font.

Returns:
  true if the font was really changed, false if it was already set to this font and nothing was done.

See also:
  GetFont(), InheritAttributes()

Reimplemented from wxWindow.

void wxAuiToolBar::SetGripperVisible | ( | bool | visible | ) |

void wxAuiToolBar::SetMargins | ( | int | x,
|  | int | y |
| ) |  |  |

void wxAuiToolBar::SetMargins | ( | int | left,
|  | int | right,
|  | int | top,
|  | int | bottom |
| ) |  |  |

void wxAuiToolBar::SetMargins | ( | const wxSize & | size | ) |

void wxAuiToolBar::SetOverflowVisible | ( | bool | visible | ) |

void wxAuiToolBar::SetToolBitmap | ( | int | tool_id,
|  | const wxBitmap & | bitmap |
| ) |  |  |

void wxAuiToolBar::SetToolBitmapSize | ( | const wxSize & | size | ) |

void wxAuiToolBar::SetToolBorderPadding | ( | int | padding | ) |

void wxAuiToolBar::SetToolDropDown | ( | int | tool_id,
|  | bool | dropdown |
| ) |  |  |

void wxAuiToolBar::SetToolLabel | ( | int | tool_id,
|  | const wxString & | label |
| ) |  |  |

void wxAuiToolBar::SetToolLongHelp | ( | int | tool_id,
|  | const wxString & | help_string |
| ) |  |  |

void wxAuiToolBar::SetToolPacking | ( | int | packing | ) |

void wxAuiToolBar::SetToolProportion | ( | int | tool_id,
|  | int | proportion |
| ) |  |  |

void wxAuiToolBar::SetToolSeparation | ( | int | separation | ) |

void wxAuiToolBar::SetToolShortHelp | ( | int | tool_id,
|  | const wxString & | help_string |
| ) |  |  |

void wxAuiToolBar::SetToolSticky | ( | int | tool_id,
|  | bool | sticky |
| ) |  |  |

void wxAuiToolBar::SetToolTextOrientation | ( | int | orientation | ) |

void wxAuiToolBar::SetWindowStyleFlag | ( | long | style | ) | `[virtual]`

Sets the style of the window.

Please note that some styles cannot be changed after the window creation and that Refresh() might need to be called after changing the others for the change to take place immediately.

See Window styles for more information about flags.

See also:
  GetWindowStyleFlag()

Reimplemented from wxWindow.

void wxAuiToolBar::ToggleTool | ( | int | tool_id,
|  | bool | state |
| ) |  |  |

|  | [ top ]