AGW Logo

agw_title AuiToolBar

AuiToolBar is a completely owner-drawn toolbar perfectly integrated with the AUI layout system. This allows drag and drop of toolbars, docking/floating behaviour and the possibility to define “overflow” items in the toolbar itself.

The default theme that is used is AuiDefaultToolBarArt, which provides a modern, glossy look and feel. The theme can be changed by calling SetArtProvider.

hierarchy Inheritance Diagram

Inheritance diagram for: AuiToolBar

Inheritance diagram of AuiToolBar


appearance Control Appearance


AuiToolBar

AuiToolBar


method_summary Methods Summary

__init__Default class constructor.
AddCheckToolAdds a new check (or toggle) tool to the AuiToolBar.
AddControlAdds any control to the toolbar, typically e.g.
AddLabelAdds a label tool to the AuiToolBar.
AddRadioToolAdds a new radio tool to the toolbar.
AddSeparatorAdds a separator for spacing groups of tools.
AddSimpleToolAdds a tool to the toolbar.
AddSpacerAdds a spacer for spacing groups of tools.
AddStretchSpacerAdds a stretchable spacer for spacing groups of tools.
AddToggleToolAdds a toggle tool to the toolbar.
AddToolAdds a tool to the toolbar.
ClearDeletes all the tools in the AuiToolBar.
ClearToolsDeletes all the tools in the AuiToolBar.
DeleteToolRemoves the specified tool from the toolbar and deletes it.
DeleteToolByPosThis function behaves like DeleteTool but it deletes the tool at the
DoGetBestSizeGets the size which best suits the window: for a control, it would be the
DoIdleUpdateUpdates the toolbar during idle times.
DoSetSizeSets the position and size of the window in pixels.
EnableToolEnables or disables the tool.
FindControlReturns a pointer to the control identified by id or None if no corresponding
FindToolFinds a tool for the given tool id.
FindToolByIndexFinds a tool for the given tool position in the AuiToolBar.
FindToolByLabelFinds a tool for the given label.
FindToolForPositionFinds a tool for the given mouse position.
FindToolForPositionWithPackingFinds a tool for the given mouse position, taking into account also the tool packing.
GetAGWWindowStyleFlagReturns the AGW-specific window style flag.
GetArtProviderReturns the current art provider being used.
GetAuiManagerReturns the AuiManager which manages the toolbar.
GetGripperVisibleReturns whether the toolbar gripper is visible or not.
GetLabelSizeReturns the standard size of a toolbar item.
GetOverflowRectReturns the rectangle of the overflow button.
GetOverflowStateReturns the state of the overflow button.
GetOverflowVisibleReturns whether the overflow button is visible or not.
GetToolBarFitsReturns whether the AuiToolBar size fits in a specified size.
GetToolBitmapReturns the tool bitmap for the tool identified by tool_id.
GetToolBitmapSizeReturns the size of bitmap that the toolbar expects to have.
GetToolBorderPaddingReturns the padding between the tool border and the label, in pixels.
GetToolCountReturns the number of tools in the AuiToolBar.
GetToolDropDownReturns whether the toolbar item identified by tool_id has an associated drop down window menu or not.
GetToolEnabledReturns whether the tool identified by tool_id is enabled or not.
GetToolFitsReturns whether the tool identified by tool_id fits into the toolbar or not.
GetToolFitsByIndexReturns whether the tool identified by tool_id fits into the toolbar or not.
GetToolIndexReturns the position of the tool in the toolbar given its identifier.
GetToolLabelReturns the tool label for the tool identified by tool_id.
GetToolLongHelpReturns the long help for the given tool.
GetToolOrientationReturns the orientation for the toolbar items.
GetToolPackingReturns the value used for spacing tools.
GetToolPosReturns the position of the tool in the toolbar given its identifier.
GetToolProportionReturns the tool proportion in the toolbar.
GetToolRectReturns the toolbar item rectangle
GetToolSeparationReturns the separator size for the toolbar, in pixels.
GetToolShortHelpReturns the short help for the given tool.
GetToolStickyReturns whether the toolbar item identified by tool_id has a sticky behaviour or not.
GetToolTextOrientationReturns the label orientation for the toolbar items.
GetToolToggledReturns whether a tool is toggled or not.
HitTestFinds a tool for the given mouse position.
IsPaneMinimizedReturns whether this AuiToolBar contains a minimized pane tool.
OnCustomRenderHandles custom render for single AuiToolBar items.
OnEraseBackgroundHandles the wx.EVT_ERASE_BACKGROUND event for AuiToolBar.
OnIdleHandles the wx.EVT_IDLE event for AuiToolBar.
OnLeaveWindowHandles the wx.EVT_LEAVE_WINDOW event for AuiToolBar.
OnLeftDownHandles the wx.EVT_LEFT_DOWN event for AuiToolBar.
OnLeftUpHandles the wx.EVT_LEFT_UP event for AuiToolBar.
OnMiddleDownHandles the wx.EVT_MIDDLE_DOWN event for AuiToolBar.
OnMiddleUpHandles the wx.EVT_MIDDLE_UP event for AuiToolBar.
OnMotionHandles the wx.EVT_MOTION event for AuiToolBar.
OnPaintHandles the wx.EVT_PAINT event for AuiToolBar.
OnRightDownHandles the wx.EVT_RIGHT_DOWN event for AuiToolBar.
OnRightUpHandles the wx.EVT_RIGHT_UP event for AuiToolBar.
OnSetCursorHandles the wx.EVT_SET_CURSOR event for AuiToolBar.
OnSizeHandles the wx.EVT_SIZE event for AuiToolBar.
RealizeRealizes the toolbar.
RefreshOverflowStateRefreshes the overflow button.
SetAGWWindowStyleFlagSets the AGW-specific style of the window.
SetArtProviderInstructs AuiToolBar to use art provider specified by parameter art
SetAuiManagerSets the AuiManager which manages the toolbar.
SetCustomOverflowItemsSets the two lists prepend and append as custom overflow items.
SetFontSets the AuiToolBar font.
SetGripperVisibleSets whether the toolbar gripper is visible or not.
SetHoverItemSets a toolbar item to be currently hovered by the mouse.
SetMarginsSet the values to be used as margins for the toolbar.
SetMarginsSizeSet the values to be used as margins for the toolbar.
SetMarginsXYSet the values to be used as margins for the toolbar.
SetOrientationSets the toolbar orientation.
SetOverflowVisibleSets whether the overflow button is visible or not.
SetPressedItemSets a toolbar item to be currently in a “pressed” state.
SetToolAlignmentThis sets the alignment for all of the tools within the toolbar (only has an effect when the toolbar is expanded).
SetToolBitmapSets the tool bitmap for the tool identified by tool_id.
SetToolBitmapSizeSets the default size of each tool bitmap.
SetToolBorderPaddingSets the padding between the tool border and the label.
SetToolDisabledBitmapSets the tool disabled bitmap for the tool identified by tool_id.
SetToolDropDownAssigns a drop down window menu to the toolbar item.
SetToolLabelSets the tool label for the tool identified by tool_id.
SetToolLongHelpSets the long help for the given tool.
SetToolNormalBitmapSets the tool bitmap for the tool identified by tool_id.
SetToolOrientationSets the tool orientation for the toolbar items.
SetToolPackingSets the value used for spacing tools.
SetToolProportionSets the tool proportion in the toolbar.
SetToolSeparationSets the separator size for the toolbar.
SetToolShortHelpSets the short help for the given tool.
SetToolStickySets the toolbar item as sticky or non-sticky.
SetToolTextOrientationSets the label orientation for the toolbar items.
SetWindowStyleFlagSets the style of the window.
StartPreviewTimerStarts a timer in AuiManager to slide-in/slide-out the minimized pane.
StopPreviewTimerStops a timer in AuiManager to slide-in/slide-out the minimized pane.
ToggleToolToggles a tool on or off.

API Class API

class AuiToolBar(wx.PyControl)[source]

AuiToolBar is a completely owner-drawn toolbar perfectly integrated with the AUI layout system. This allows drag and drop of toolbars, docking/floating behaviour and the possibility to define “overflow” items in the toolbar itself.

The default theme that is used is AuiDefaultToolBarArt, which provides a modern, glossy look and feel. The theme can be changed by calling AuiToolBar.SetArtProvider().



__init__(parent, id=wx.ID_ANY, pos=wx.DefaultPosition, size=wx.DefaultSize, style=0, agwStyle=AUI_TB_DEFAULT_STYLE)[source]

Default class constructor.

Parameters:
  • parent – the AuiToolBar parent;
  • id – an identifier for the control: a value of -1 is taken to mean a default;
  • pos – the control position. A value of (-1, -1) indicates a default position, chosen by either the windowing system or wxPython, depending on platform;
  • size – the control size. A value of (-1, -1) indicates a default size, chosen by either the windowing system or wxPython, depending on platform;
  • style – the control window style;
  • agwStyle – the AGW-specific window style. This can be a combination of the following bits:


    Flag name Description
    AUI_TB_TEXT Shows the text in the toolbar buttons; by default only icons are shown
    AUI_TB_NO_TOOLTIPS Don’t show tooltips on AuiToolBar items
    AUI_TB_NO_AUTORESIZE Do not auto-resize the AuiToolBar
    AUI_TB_GRIPPER Shows a gripper on the AuiToolBar
    AUI_TB_OVERFLOW The AuiToolBar can contain overflow items
    AUI_TB_VERTICAL The AuiToolBar is vertical
    AUI_TB_HORZ_LAYOUT Shows the text and the icons alongside, not vertically stacked. This style must be used with AUI_TB_TEXT
    AUI_TB_PLAIN_BACKGROUND Don’t draw a gradient background on the toolbar
    AUI_TB_HORZ_TEXT Combination of AUI_TB_HORZ_LAYOUT and AUI_TB_TEXT

    The default value for agwStyle is: AUI_TB_DEFAULT_STYLE = 0



AddCheckTool(tool_id, label, bitmap, disabled_bitmap, short_help_string='', long_help_string='', client_data=None)[source]

Adds a new check (or toggle) tool to the AuiToolBar.

See also

AddTool.



AddControl(control, label='')[source]

Adds any control to the toolbar, typically e.g. a combobox.

Parameters:
  • control – the control to be added;
  • label – the label which appears if the control goes into the overflow items in the toolbar.


AddLabel(tool_id, label='', width=0)[source]

Adds a label tool to the AuiToolBar.

Parameters:
  • tool_id – an integer by which the tool may be identified in subsequent operations;
  • label – the toolbar tool label;
  • width – the tool width.


AddRadioTool(tool_id, label, bitmap, disabled_bitmap, short_help_string='', long_help_string='', client_data=None)[source]

Adds a new radio tool to the toolbar.

Consecutive radio tools form a radio group such that exactly one button in the group is pressed at any moment, in other words whenever a button in the group is pressed the previously pressed button is automatically released. You should avoid having the radio groups of only one element as it would be impossible for the user to use such button.

Note

By default, the first button in the radio group is initially pressed, the others are not.

See also

AddTool.



AddSeparator()[source]

Adds a separator for spacing groups of tools.



AddSimpleTool(tool_id, label, bitmap, short_help_string="", kind=ITEM_NORMAL, target=None)[source]

Adds a tool to the toolbar. This is the simplest method you can use to ass an item to the AuiToolBar.

Parameters:
  • tool_id – an integer by which the tool may be identified in subsequent operations;
  • label – the toolbar tool label;
  • bitmap – the primary tool bitmap;
  • short_help_string – this string is used for the tools tooltip;
  • kind – the item kind. Can be one of the following:


    Item Kind Description
    ITEM_CONTROL The item in the AuiToolBar is a control
    ITEM_LABEL The item in the AuiToolBar is a text label
    ITEM_SPACER The item in the AuiToolBar is a spacer
    ITEM_SEPARATOR The item in the AuiToolBar is a separator
    ITEM_CHECK The item in the AuiToolBar is a toolbar check item
    ITEM_NORMAL The item in the AuiToolBar is a standard toolbar item
    ITEM_RADIO The item in the AuiToolBar is a toolbar radio item
  • target – a custom string indicating that an instance of AuiPaneInfo has been minimized into this toolbar.


AddSpacer(pixels)[source]

Adds a spacer for spacing groups of tools.

Parameters:pixels – the width of the spacer.


AddStretchSpacer(proportion=1)[source]

Adds a stretchable spacer for spacing groups of tools.

Parameters:proportion – the stretchable spacer proportion.


AddToggleTool(tool_id, bitmap, disabled_bitmap, toggle=False, client_data=None, short_help_string='', long_help_string='')[source]

Adds a toggle tool to the toolbar.

Parameters:
  • tool_id – an integer by which the tool may be identified in subsequent operations;
  • bitmap – the primary tool bitmap;
  • disabled_bitmap – the bitmap to use when the tool is disabled. If it is equal to wx.NullBitmap, the disabled bitmap is automatically generated by greing the normal one;
  • client_data – whatever Python object to associate with the toolbar item;
  • short_help_string – this string is used for the tools tooltip;
  • long_help_string – this string is shown in the statusbar (if any) of the parent frame when the mouse pointer is inside the tool.


AddTool(tool_id, label, bitmap, disabled_bitmap, kind, short_help_string='', long_help_string='', client_data=None, target=None)[source]

Adds a tool to the toolbar. This is the full feature version of AddTool.

Parameters:
  • tool_id – an integer by which the tool may be identified in subsequent operations;
  • label – the toolbar tool label;
  • bitmap – the primary tool bitmap;
  • disabled_bitmap – the bitmap to use when the tool is disabled. If it is equal to wx.NullBitmap, the disabled bitmap is automatically generated by greing the normal one;
  • kind – the item kind. Can be one of the following:


    Item Kind Description
    ITEM_CONTROL The item in the AuiToolBar is a control
    ITEM_LABEL The item in the AuiToolBar is a text label
    ITEM_SPACER The item in the AuiToolBar is a spacer
    ITEM_SEPARATOR The item in the AuiToolBar is a separator
    ITEM_CHECK The item in the AuiToolBar is a toolbar check item
    ITEM_NORMAL The item in the AuiToolBar is a standard toolbar item
    ITEM_RADIO The item in the AuiToolBar is a toolbar radio item
  • short_help_string – this string is used for the tools tooltip;
  • long_help_string – this string is shown in the statusbar (if any) of the parent frame when the mouse pointer is inside the tool.
  • client_data – whatever Python object to associate with the toolbar item.
  • target – a custom string indicating that an instance of AuiPaneInfo has been minimized into this toolbar.


Clear()[source]

Deletes all the tools in the AuiToolBar.



ClearTools()[source]

Deletes all the tools in the AuiToolBar.



DeleteTool(tool_id)[source]

Removes the specified tool from the toolbar and deletes it.

Parameters:tool_id – the AuiToolBarItem identifier.
Returns:True if the tool was deleted, False otherwise.

Note

Note that it is unnecessary to call Realize for the change to take place, it will happen immediately.



DeleteToolByPos(pos)[source]

This function behaves like DeleteTool but it deletes the tool at the specified position and not the one with the given id.

Parameters:pos – the tool position.

See also

DeleteTool



DoGetBestSize()[source]

Gets the size which best suits the window: for a control, it would be the minimal size which doesn’t truncate the control, for a panel - the same size as it would have after a call to Fit().

Note

Overridden from wx.PyControl.



DoIdleUpdate()[source]

Updates the toolbar during idle times.



DoSetSize(x, y, width, height, sizeFlags=wx.SIZE_AUTO)[source]

Sets the position and size of the window in pixels. The sizeFlags parameter indicates the interpretation of the other params if they are equal to -1.

Parameters:
  • x – the window x position;
  • y – the window y position;
  • width – the window width;
  • height – the window height;
  • sizeFlags – may have one of this bit set:


    Size Flags Description
    wx.SIZE_AUTO A -1 indicates that a class-specific default should be used.
    wx.SIZE_AUTO_WIDTH A -1 indicates that a class-specific default should be used for the width.
    wx.SIZE_AUTO_HEIGHT A -1 indicates that a class-specific default should be used for the height.
    wx.SIZE_USE_EXISTING Existing dimensions should be used if -1 values are supplied.
    wx.SIZE_ALLOW_MINUS_ONE Allow dimensions of -1 and less to be interpreted as real dimensions, not default values.
    wx.SIZE_FORCE Normally, if the position and the size of the window are already the same as the parameters of this function, nothing is done. but with this flag a window resize may be forced even in this case (supported in wx 2.6.2 and later and only implemented for MSW and ignored elsewhere currently)

Note

Overridden from wx.PyControl.



EnableTool(tool_id, state)[source]

Enables or disables the tool.

Parameters:
  • tool_id – identifier for the tool to enable or disable.
  • state – if True, enables the tool, otherwise disables it.


FindControl(id)[source]

Returns a pointer to the control identified by id or None if no corresponding control is found.

Parameters:id – the control identifier.


FindTool(tool_id)[source]

Finds a tool for the given tool id.

Parameters:tool_id – the AuiToolBarItem identifier.


FindToolByIndex(pos)[source]

Finds a tool for the given tool position in the AuiToolBar.

Parameters:pos – the tool position in the toolbar.
Returns:a pointer to a AuiToolBarItem if a tool is found, or None otherwise.


FindToolByLabel(label)[source]

Finds a tool for the given label.

Parameters:tool_id – the AuiToolBarItem label.


FindToolForPosition(x, y)[source]

Finds a tool for the given mouse position.

Parameters:
  • x – mouse x position;
  • y – mouse y position.
Returns:

a pointer to a AuiToolBarItem if a tool is found, or None otherwise.



FindToolForPositionWithPacking(x, y)[source]

Finds a tool for the given mouse position, taking into account also the tool packing.

Parameters:
  • x – mouse x position;
  • y – mouse y position.
Returns:

a pointer to a AuiToolBarItem if a tool is found, or None otherwise.



GetAGWWindowStyleFlag()[source]

Returns the AGW-specific window style flag.

See also

SetAGWWindowStyleFlag for an explanation of various AGW-specific style.



GetArtProvider()[source]

Returns the current art provider being used.



GetAuiManager()[source]

Returns the AuiManager which manages the toolbar.



GetGripperVisible()[source]

Returns whether the toolbar gripper is visible or not.



GetLabelSize(label)[source]

Returns the standard size of a toolbar item.

Parameters:label – a test label.


GetOverflowRect()[source]

Returns the rectangle of the overflow button.



GetOverflowState()[source]

Returns the state of the overflow button.



GetOverflowVisible()[source]

Returns whether the overflow button is visible or not.



GetToolBarFits()[source]

Returns whether the AuiToolBar size fits in a specified size.



GetToolBitmap(tool_id)[source]

Returns the tool bitmap for the tool identified by tool_id.

Parameters:tool_id – the tool identifier.


GetToolBitmapSize()[source]

Returns the size of bitmap that the toolbar expects to have. The default bitmap size is 16 by 15 pixels.

Note

Note that this is the size of the bitmap you pass to AddTool, and not the eventual size of the tool button.

Todo

Add wx.ToolBar compatibility, actually implementing this method.



GetToolBorderPadding()[source]

Returns the padding between the tool border and the label, in pixels.



GetToolCount()[source]

Returns the number of tools in the AuiToolBar.



GetToolDropDown(tool_id)[source]

Returns whether the toolbar item identified by tool_id has an associated drop down window menu or not.

Parameters:tool_id – the AuiToolBarItem identifier.


GetToolEnabled(tool_id)[source]

Returns whether the tool identified by tool_id is enabled or not.

Parameters:tool_id – the tool identifier.


GetToolFits(tool_id)[source]

Returns whether the tool identified by tool_id fits into the toolbar or not.

Parameters:tool_id – the toolbar item identifier.


GetToolFitsByIndex(tool_id)[source]

Returns whether the tool identified by tool_id fits into the toolbar or not.

Parameters:tool_id – the toolbar item identifier.


GetToolIndex(tool_id)[source]

Returns the position of the tool in the toolbar given its identifier.

Parameters:tool_id – the toolbar item identifier.


GetToolLabel(tool_id)[source]

Returns the tool label for the tool identified by tool_id.

Parameters:tool_id – the tool identifier.


GetToolLongHelp(tool_id)[source]

Returns the long help for the given tool.

Parameters:tool_id – the tool identifier.


GetToolOrientation()[source]

Returns the orientation for the toolbar items.



GetToolPacking()[source]

Returns the value used for spacing tools. The default value is 1 pixel.



GetToolPos(tool_id)[source]

Returns the position of the tool in the toolbar given its identifier.

Parameters:tool_id – the toolbar item identifier.


GetToolProportion(tool_id)[source]

Returns the tool proportion in the toolbar.

Parameters:tool_id – the AuiToolBarItem identifier.


GetToolRect(tool_id)[source]

Returns the toolbar item rectangle

Parameters:tool_id – the toolbar item identifier.


GetToolSeparation()[source]

Returns the separator size for the toolbar, in pixels.



GetToolShortHelp(tool_id)[source]

Returns the short help for the given tool.

Parameters:tool_id – the tool identifier.


GetToolSticky(tool_id)[source]

Returns whether the toolbar item identified by tool_id has a sticky behaviour or not.

Parameters:tool_id – the AuiToolBarItem identifier.


GetToolTextOrientation()[source]

Returns the label orientation for the toolbar items.



GetToolToggled(tool_id)[source]

Returns whether a tool is toggled or not.

Parameters:tool_id – the toolbar item identifier.

Note

This only applies to a tool that has been specified as a toggle tool.



HitTest(x, y)[source]

Finds a tool for the given mouse position.

Parameters:
  • x – mouse x position;
  • y – mouse y position.
Returns:

a pointer to a AuiToolBarItem if a tool is found, or None otherwise.

Note

This method is similar to FindToolForPosition but it works with absolute coordinates.



IsPaneMinimized()[source]

Returns whether this AuiToolBar contains a minimized pane tool.



OnCustomRender(dc, item, rect)[source]

Handles custom render for single AuiToolBar items.

Parameters:
  • dc – a wx.DC device context;
  • item – an instance of AuiToolBarItem;
  • rect – the toolbar item rect.

Note

This method must be overridden to provide custom rendering of items.



OnEraseBackground(event)[source]

Handles the wx.EVT_ERASE_BACKGROUND event for AuiToolBar.

Parameters:event – a wx.EraseEvent event to be processed.

Note

This is intentionally empty, to reduce flicker.



OnIdle(event)[source]

Handles the wx.EVT_IDLE event for AuiToolBar.

Parameters:event – a wx.IdleEvent event to be processed.


OnLeaveWindow(event)[source]

Handles the wx.EVT_LEAVE_WINDOW event for AuiToolBar.

Parameters:event – a wx.MouseEvent event to be processed.


OnLeftDown(event)[source]

Handles the wx.EVT_LEFT_DOWN event for AuiToolBar.

Parameters:event – a wx.MouseEvent event to be processed.



OnLeftUp(event)[source]

Handles the wx.EVT_LEFT_UP event for AuiToolBar.

Parameters:event – a wx.MouseEvent event to be processed.



OnMiddleDown(event)[source]

Handles the wx.EVT_MIDDLE_DOWN event for AuiToolBar.

Parameters:event – a wx.MouseEvent event to be processed.



OnMiddleUp(event)[source]

Handles the wx.EVT_MIDDLE_UP event for AuiToolBar.

Parameters:event – a wx.MouseEvent event to be processed.



OnMotion(event)[source]

Handles the wx.EVT_MOTION event for AuiToolBar.

Parameters:event – a wx.MouseEvent event to be processed.



OnPaint(event)[source]

Handles the wx.EVT_PAINT event for AuiToolBar.

Parameters:event – a wx.PaintEvent event to be processed.


OnRightDown(event)[source]

Handles the wx.EVT_RIGHT_DOWN event for AuiToolBar.

Parameters:event – a wx.MouseEvent event to be processed.



OnRightUp(event)[source]

Handles the wx.EVT_RIGHT_UP event for AuiToolBar.

Parameters:event – a wx.MouseEvent event to be processed.



OnSetCursor(event)[source]

Handles the wx.EVT_SET_CURSOR event for AuiToolBar.

Parameters:event – a wx.SetCursorEvent event to be processed.


OnSize(event)[source]

Handles the wx.EVT_SIZE event for AuiToolBar.

Parameters:event – a wx.SizeEvent event to be processed.


Realize()[source]

Realizes the toolbar. This function should be called after you have added tools.



RefreshOverflowState()[source]

Refreshes the overflow button.



SetAGWWindowStyleFlag(agwStyle)[source]

Sets the AGW-specific style of the window.

Parameters:agwStyle – the new window style. This can be a combination of the following bits:


Flag name Description
AUI_TB_TEXT Shows the text in the toolbar buttons; by default only icons are shown
AUI_TB_NO_TOOLTIPS Don’t show tooltips on AuiToolBar items
AUI_TB_NO_AUTORESIZE Do not auto-resize the AuiToolBar
AUI_TB_GRIPPER Shows a gripper on the AuiToolBar
AUI_TB_OVERFLOW The AuiToolBar can contain overflow items
AUI_TB_VERTICAL The AuiToolBar is vertical
AUI_TB_HORZ_LAYOUT Shows the text and the icons alongside, not vertically stacked. This style must be used with AUI_TB_TEXT
AUI_TB_PLAIN_BACKGROUND Don’t draw a gradient background on the toolbar
AUI_TB_HORZ_TEXT Combination of AUI_TB_HORZ_LAYOUT and AUI_TB_TEXT

Note

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



SetArtProvider(art)[source]

Instructs AuiToolBar to use art provider specified by parameter art for all drawing calls. This allows plugable look-and-feel features.

Parameters:art – an art provider.

Note

The previous art provider object, if any, will be deleted by AuiToolBar.



SetAuiManager(auiManager)[source]

Sets the AuiManager which manages the toolbar.



SetCustomOverflowItems(prepend, append)[source]

Sets the two lists prepend and append as custom overflow items.

Parameters:


SetFont(font)[source]

Sets the AuiToolBar font.

Parameters:font – a wx.Font object.

Note

Overridden from wx.PyControl.



SetGripperVisible(visible)[source]

Sets whether the toolbar gripper is visible or not.

Parameters:visibleTrue for a visible gripper, False otherwise.


SetHoverItem(pitem)[source]

Sets a toolbar item to be currently hovered by the mouse.

Parameters:pitem – an instance of AuiToolBarItem.


SetMargins(left=-1, right=-1, top=-1, bottom=-1)[source]

Set the values to be used as margins for the toolbar.

Parameters:
  • left – the left toolbar margin;
  • right – the right toolbar margin;
  • top – the top toolbar margin;
  • bottom – the bottom toolbar margin.


SetMarginsSize(size)[source]

Set the values to be used as margins for the toolbar.

Parameters:size – the margin size (an instance of wx.Size).


SetMarginsXY(x, y)[source]

Set the values to be used as margins for the toolbar.

Parameters:
  • x – left margin, right margin and inter-tool separation value;
  • y – top margin, bottom margin and inter-tool separation value.


SetOrientation(orientation)[source]

Sets the toolbar orientation.

Parameters:orientation – either wx.VERTICAL or wx.HORIZONTAL.

Note

This can be temporarily overridden by AuiManager when floating and docking a AuiToolBar.



SetOverflowVisible(visible)[source]

Sets whether the overflow button is visible or not.

Parameters:visibleTrue for a visible overflow button, False otherwise.


SetPressedItem(pitem)[source]

Sets a toolbar item to be currently in a “pressed” state.

Parameters:pitem – an instance of AuiToolBarItem.


SetToolAlignment(alignment=wx.EXPAND)[source]

This sets the alignment for all of the tools within the toolbar (only has an effect when the toolbar is expanded).

Parameters:alignmentwx.Sizer alignment value (wx.ALIGN_CENTER_HORIZONTAL or wx.ALIGN_CENTER_VERTICAL).


SetToolBitmap(tool_id, bitmap)[source]

Sets the tool bitmap for the tool identified by tool_id.

Parameters:
  • tool_id – the tool identifier;
  • bitmap – the new bitmap for the toolbar item (an instance of wx.Bitmap).


SetToolBitmapSize(size)[source]

Sets the default size of each tool bitmap. The default bitmap size is 16 by 15 pixels.

Parameters:size – the size of the bitmaps in the toolbar.

Note

This should be called to tell the toolbar what the tool bitmap size is. Call it before you add tools.

Note

Note that this is the size of the bitmap you pass to AddTool, and not the eventual size of the tool button.

Todo

Add wx.ToolBar compatibility, actually implementing this method.



SetToolBorderPadding(padding)[source]

Sets the padding between the tool border and the label.

Parameters:padding – the padding in pixels.


SetToolDisabledBitmap(tool_id, bitmap)[source]

Sets the tool disabled bitmap for the tool identified by tool_id.

Parameters:
  • tool_id – the tool identifier;
  • bitmap – the new disabled bitmap for the toolbar item (an instance of wx.Bitmap).



SetToolDropDown(tool_id, dropdown)[source]

Assigns a drop down window menu to the toolbar item.

Parameters:
  • tool_id – the AuiToolBarItem identifier;
  • dropdown – whether to assign a drop down menu or not.


SetToolLabel(tool_id, label)[source]

Sets the tool label for the tool identified by tool_id.

Parameters:
  • tool_id – the tool identifier;
  • label – the new toolbar item label.


SetToolLongHelp(tool_id, help_string)[source]

Sets the long help for the given tool.

Parameters:
  • tool_id – the tool identifier;
  • help_string – the string for the long help.


SetToolNormalBitmap(tool_id, bitmap)[source]

Sets the tool bitmap for the tool identified by tool_id.

Parameters:
  • tool_id – the tool identifier;
  • bitmap – the new bitmap for the toolbar item (an instance of wx.Bitmap).



SetToolOrientation(orientation)[source]

Sets the tool orientation for the toolbar items.

Parameters:orientation – the AuiToolBarItem orientation.


SetToolPacking(packing)[source]

Sets the value used for spacing tools. The default value is 1 pixel.

Parameters:packing – the value for packing.


SetToolProportion(tool_id, proportion)[source]

Sets the tool proportion in the toolbar.

Parameters:
  • tool_id – the AuiToolBarItem identifier;
  • proportion – the tool proportion in the toolbar.


SetToolSeparation(separation)[source]

Sets the separator size for the toolbar.

Parameters:separation – the separator size in pixels.


SetToolShortHelp(tool_id, help_string)[source]

Sets the short help for the given tool.

Parameters:
  • tool_id – the tool identifier;
  • help_string – the string for the short help.


SetToolSticky(tool_id, sticky)[source]

Sets the toolbar item as sticky or non-sticky.

Parameters:
  • tool_id – the AuiToolBarItem identifier;
  • sticky – whether the tool should be sticky or not.


SetToolTextOrientation(orientation)[source]

Sets the label orientation for the toolbar items.

Parameters:orientation – the AuiToolBarItem label orientation.


SetWindowStyleFlag(style)[source]

Sets the style of the window.

Parameters:style – the new window style.

Note

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

Note

Overridden from wx.PyControl.



StartPreviewTimer()[source]

Starts a timer in AuiManager to slide-in/slide-out the minimized pane.



StopPreviewTimer()[source]

Stops a timer in AuiManager to slide-in/slide-out the minimized pane.



ToggleTool(tool_id, state)[source]

Toggles a tool on or off. This does not cause any event to get emitted.

Parameters:
  • tool_id – tool in question.
  • state – if True, toggles the tool on, otherwise toggles it off.

Note

This only applies to a tool that has been specified as a toggle tool.

Tree

Table Of Contents

Previous topic

AuiDefaultToolBarArt

Next topic

AuiToolBarEvent