Inheritance diagram for 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 AuiToolBar.SetArtProvider.
Bases: wx._controls.PyControl
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.
Default class constructor.
Parameters: |
|
---|
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 style is: AUI_TB_DEFAULT_STYLE = 0
Adds any control to the toolbar, typically e.g. a combobox.
Parameters: |
|
---|
Adds a label tool to the L{AuiToolBar}.
Parameters: |
|
---|
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.
By default, the first button in the radio group is initially pressed, the others are not.
The parameters are the same as in L{AddTool}.
Adds a tool to the toolbar. This is the simplest method you can use to ass an item to the L{AuiToolBar}.
Parameters: |
|
---|
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 |
Adds a spacer for spacing groups of tools.
Parameter: | pixels – the width of the spacer. |
---|
Adds a stretchable spacer for spacing groups of tools.
Parameter: | proportion – the stretchable spacer proportion. |
---|
Adds a toggle tool to the toolbar.
Parameters: |
|
---|
Adds a tool to the toolbar. This is the full feature version of AddTool.
Parameters: |
|
---|
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 |
Parameters: |
|
---|
Removes the specified tool from the toolbar and deletes it. If you don’t want to delete the tool, but just to remove it from the toolbar (to possibly add it back later), you may use L{RemoveTool} instead.
Parameter: | tool_id – the L{AuiToolBarItem} identifier. |
---|
@note: Note that it is unnecessary to call L{Realize} for the change to take place, it will happen immediately.
Returns True if the tool was deleted, False otherwise.
This function behaves like L{DeleteTool} but it deletes the tool at the specified position and not the one with the given id.
Parameter: | pos – the tool position. |
---|
Overridden from wx.PyControl.
Sets the position and size of the window in pixels. The flags parameter indicates the interpretation of the other params if they are equal to -1.
Parameters: |
|
---|
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) |
Enables or disables the tool.
Parameters: |
|
---|
Returns a pointer to the control identified by id or None if no corresponding control is found.
Parameter: | id – the control identifier. |
---|
Finds a tool for the given tool id.
Parameter: | tool_id – the L{AuiToolBarItem} identifier. |
---|
Finds a tool for the given tool position in the L{AuiToolBar}.
Parameter: | pos – the tool position in the toolbar. |
---|
Finds a tool for the given mouse position.
Parameters: |
|
---|
Returns a pointer to a L{AuiToolBarItem} if a tool is found, or None otherwise.
Finds a tool for the given mouse position, taking into account also the tool packing.
Parameters: |
|
---|
Returns a pointer to a L{AuiToolBarItem} if a tool is found, or None otherwise.
Returns the standard size of a toolbar item.
Parameter: | label – a test label. |
---|
Returns the tool bitmap for the tool identified by tool_id.
Parameter: | tool_id – the tool identifier. |
---|
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 L{AddTool}, and not the eventual size of the tool button.
Returns whether the toolbar item identified by tool_id has an associated drop down window menu or not.
Parameter: | tool_id – the L{AuiToolBarItem} identifier. |
---|
Returns whether the tool identified by tool_id is enabled or not.
Parameter: | tool_id – the tool identifier. |
---|
Returns whether the tool identified by tool_id fits into the toolbar or not.
Parameter: | tool_id – the toolbar item identifier. |
---|
Returns whether the tool identified by tool_idx fits into the toolbar or not.
Parameter: | tool_idx – the toolbar item identifier. |
---|
Returns the position of the tool in the toolbar given its identifier.
Parameter: | tool_id – the toolbar item identifier. |
---|
Returns the tool label for the tool identified by tool_id.
Parameter: | tool_id – the tool identifier. |
---|
Returns the long help for the given tool.
Parameter: | tool_id – the tool identifier. |
---|
Returns the position of the tool in the toolbar given its identifier.
Parameter: | tool_id – the toolbar item identifier. |
---|
Returns the tool proportion in the toolbar.
Parameter: | tool_id – the L{AuiToolBarItem} identifier. |
---|
Returns the toolbar item rectangle
Parameter: | tool_id – the toolbar item identifier. |
---|
Returns the short help for the given tool.
Parameter: | tool_id – the tool identifier. |
---|
Returns whether the toolbar item identified by tool_id has a sticky behaviour or not.
Parameter: | tool_id – the L{AuiToolBarItem} identifier. |
---|
Returns whether a tool is toggled or not.
Parameter: | tool_id – the toolbar item identifier. |
---|
@note: only applies to a tool that has been specified as a toggle tool.
Handles custom render for single L{AuiToolBar} items. This method must be ocverridden to provide custom rendering of items.
Parameters: |
|
---|
Handles the wx.EVT_ERASE_BACKGROUND event for L{AuiToolBar}. This is intentionally empty, to reduce flicker.
Parameter: | event – a L{wx.EraseEvent} event to be processed. |
---|
Handles the wx.EVT_IDLE event for L{AuiToolBar}.
Parameter: | event – a L{wx.IdleEvent} event to be processed. |
---|
Handles the wx.EVT_LEAVE_WINDOW event for L{AuiToolBar}.
Parameter: | event – a L{wx.MouseEvent} event to be processed. |
---|
Handles the wx.EVT_LEFT_DOWN event for L{AuiToolBar}.
Parameter: | event – a L{wx.MouseEvent} event to be processed. |
---|
Handles the wx.EVT_LEFT_UP event for L{AuiToolBar}.
Parameter: | event – a L{wx.MouseEvent} event to be processed. |
---|
Handles the wx.EVT_MIDDLE_DOWN event for L{AuiToolBar}.
Parameter: | event – a L{wx.MouseEvent} event to be processed. |
---|
Handles the wx.EVT_MIDDLE_UP event for L{AuiToolBar}.
Parameter: | event – a L{wx.MouseEvent} event to be processed. |
---|
Handles the wx.EVT_MOTION event for L{AuiToolBar}.
Parameter: | event – a L{wx.MouseEvent} event to be processed. |
---|
Handles the wx.EVT_PAINT event for L{AuiToolBar}.
Parameter: | event – a L{wx.PaintEvent} event to be processed. |
---|
Handles the wx.EVT_RIGHT_DOWN event for L{AuiToolBar}.
Parameter: | event – a L{wx.MouseEvent} event to be processed. |
---|
Handles the wx.EVT_RIGHT_UP event for L{AuiToolBar}.
Parameter: | event – a L{wx.MouseEvent} event to be processed. |
---|
Handles the wx.EVT_SET_CURSOR event for L{AuiToolBar}.
Parameter: | event – a L{wx.SetCursorEvent} event to be processed. |
---|
Handles the wx.EVT_SIZE event for L{AuiToolBar}.
Parameter: | event – a L{wx.SizeEvent} event to be processed. |
---|
Instructs L{AuiToolBar} to use art provider specified by parameter art for all drawing calls. This allows plugable look-and-feel features. The previous art provider object, if any, will be deleted by L{AuiToolBar}.
Parameter: | art – an art provider. |
---|
Sets the two lists prepend and append as custom overflow items
Parameters: |
|
---|
Overridden from wx.PyControl. Sets the L{AuiToolBar} font.
Parameter: | font – a wx.Font object. |
---|
Sets whether the toolbar gripper is visible or not.
Parameter: | visible – True for a visible gripper, False otherwise. |
---|
Sets a toolbar item to be currently hovered by the mouse.
Parameter: | pitem – an instance of L{AuiToolBarItem}. |
---|
Set the values to be used as margins for the toolbar.
Parameters: |
|
---|
Set the values to be used as margins for the toolbar.
Parameter: | size – the margin size |
---|
Set the values to be used as margins for the toolbar.
Parameters: |
|
---|
Sets the toolbar orientation. Overridden by AuiManager.
Parameter: | orientation – either wx.VERTICAL or wx.HORIZONTAL. |
---|
Sets whether the overflow button is visible or not.
Parameter: | visible – True for a visible overflow button, False otherwise. |
---|
Sets a toolbar item to be currently in a “pressed” state.
Parameter: | pitem – an instance of L{AuiToolBarItem}. |
---|
Sets the tool bitmap for the tool identified by tool_id.
Parameters: |
|
---|
Sets the default size of each tool bitmap. The default bitmap size is 16 by 15 pixels.
Parameter: | 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 L{AddTool}, and not the eventual size of the tool button.
Sets the padding between the tool border and the label.
Parameter: | padding – the padding in pixels. |
---|
Sets the tool disabled bitmap for the tool identified by tool_id.
Parameters: |
|
---|
Assigns a drop down window menu to the toolbar item.
Parameters: |
|
---|
Sets the tool label for the tool identified by tool_id.
Parameters: |
|
---|
Sets the long help for the given tool.
Parameters: |
|
---|
Sets the tool bitmap for the tool identified by tool_id.
Parameters: |
|
---|
Sets the value used for spacing tools. The default value is 1.
Parameter: | packing – the value for packing. |
---|
Sets the tool proportion in the toolbar.
Parameters: |
|
---|
Sets the separator size for the toolbar.
Parameter: | separation – the separator size in pixels. |
---|
Sets the short help for the given tool.
Parameters: |
|
---|
Sets the toolbar item as sticky or non-sticky.
Parameters: |
|
---|
Sets the label orientation for the toolbar items.
Parameter: | orientation – the L{AuiToolBarItem} label orientation. |
---|
Overridden from wx.PyControl. Sets the style of the window.
Parameter: | 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.
Toggles a tool on or off. This does not cause any event to get emitted.
Parameters: |
|
---|
@note: only applies to a tool that has been specified as a toggle tool.