AGW Logo

agw_title AuiToolBarItem

AuiToolBarItem is a toolbar element.

It has a unique id (except for the separators which always have id = -1), the style (telling whether it is a normal button, separator or a control), the state (toggled or not, enabled or not) and short and long help strings. The default implementations use the short help string for the tooltip text which is popped up when the mouse pointer enters the tool and the long help string for the applications status bar.

hierarchy Inheritance Diagram

Inheritance diagram for: AuiToolBarItem

Inheritance diagram of AuiToolBarItem


method_summary Methods Summary

__init__Default class constructor.
AssignAssigns the properties of the AuiToolBarItem c to self.
GetAlignmentReturns the toolbar item alignment.
GetBitmapReturns the toolbar item bitmap.
GetDisabledBitmapReturns the toolbar item disabled bitmap.
GetHoverBitmapReturns the toolbar item hover bitmap.
GetIdReturns the toolbar item identifier.
GetKindReturns the toolbar item kind.
GetLabelReturns the toolbar item label.
GetLongHelpReturns the long help string for the AuiToolBarItem.
GetMinSizeReturns the toolbar item minimum size.
GetOrientationReturns the toolbar tool orientation.
GetProportionReturns the AuiToolBarItem proportion in the toolbar.
GetRotatedBitmapReturns the correct bitmap depending on the tool orientation.
GetShortHelpReturns the short help string for the AuiToolBarItem.
GetSizerItemReturns the associated sizer item.
GetSpacerPixelsReturns the number of pixels for a toolbar item with kind = ITEM_SEPARATOR.
GetStateReturns the toolbar item state.
GetUserDataReturns the associated user data.
GetWindowReturns window associated to the toolbar item.
HasDropDownReturns whether the toolbar item has an associated dropdown menu or not.
IsActiveReturns whether the toolbar item is active or not.
IsStickyReturns whether the toolbar item has a sticky behaviour or not.
SetActiveActivates/deactivates the toolbar item.
SetAlignmentSets the toolbar item alignment.
SetBitmapSets the toolbar item bitmap.
SetDisabledBitmapSets the toolbar item disabled bitmap.
SetHasDropDownSets whether the toolbar item has an associated dropdown menu.
SetHoverBitmapSets the toolbar item hover bitmap.
SetIdSets the toolbar item identifier.
SetKindSets the AuiToolBarItem kind.
SetLabelSets the toolbar item label.
SetLongHelpSets the long help string for the toolbar item.
SetMinSizeSets the toolbar item minimum size.
SetOrientationSets the toolbar tool orientation.
SetProportionSets the AuiToolBarItem proportion in the toolbar.
SetShortHelpSets the short help string for the AuiToolBarItem, to be displayed in a
SetSizerItemAssociates a sizer item to this toolbar item.
SetSpacerPixelsSets the number of pixels for a toolbar item with kind = ITEM_SEPARATOR.
SetStateSets the toolbar item state.
SetStickySets whether the toolbar item is sticky (permanent highlight after mouse enter) or not.
SetUserDataAssociates some kind of user data to the toolbar item.
SetWindowAssigns a window to the toolbar item.

API Class API

class AuiToolBarItem(object)[source]

AuiToolBarItem is a toolbar element.

It has a unique id (except for the separators which always have id = -1), the style (telling whether it is a normal button, separator or a control), the state (toggled or not, enabled or not) and short and long help strings. The default implementations use the short help string for the tooltip text which is popped up when the mouse pointer enters the tool and the long help string for the applications status bar.



__init__(item=None)[source]

Default class constructor.

Parameters:item – another instance of AuiToolBarItem.


Assign(c)[source]

Assigns the properties of the AuiToolBarItem c to self.

Parameters:c – another instance of AuiToolBarItem.


GetAlignment()[source]

Returns the toolbar item alignment.



GetBitmap()[source]

Returns the toolbar item bitmap.



GetDisabledBitmap()[source]

Returns the toolbar item disabled bitmap.



GetHoverBitmap()[source]

Returns the toolbar item hover bitmap.



GetId()[source]

Returns the toolbar item identifier.



GetKind()[source]

Returns the toolbar item kind. See SetKind for more details.



GetLabel()[source]

Returns the toolbar item label.



GetLongHelp()[source]

Returns the long help string for the AuiToolBarItem.



GetMinSize()[source]

Returns the toolbar item minimum size.



GetOrientation()[source]

Returns the toolbar tool orientation.



GetProportion()[source]

Returns the AuiToolBarItem proportion in the toolbar.



GetRotatedBitmap(disabled)[source]

Returns the correct bitmap depending on the tool orientation.

Parameters:disabled – whether to return the disabled bitmap or not.


GetShortHelp()[source]

Returns the short help string for the AuiToolBarItem.



GetSizerItem()[source]

Returns the associated sizer item.



GetSpacerPixels()[source]

Returns the number of pixels for a toolbar item with kind = ITEM_SEPARATOR.



GetState()[source]

Returns the toolbar item state. See SetState for more details.

See also

SetState



GetUserData()[source]

Returns the associated user data.



GetWindow()[source]

Returns window associated to the toolbar item.



HasDropDown()[source]

Returns whether the toolbar item has an associated dropdown menu or not.



IsActive()[source]

Returns whether the toolbar item is active or not.



IsSticky()[source]

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



SetActive(b)[source]

Activates/deactivates the toolbar item.

Parameters:bTrue to activate the item, False to deactivate it.


SetAlignment(l)[source]

Sets the toolbar item alignment.

Parameters:l – the item alignment, which can be one of the available wx.Sizer alignments.


SetBitmap(bmp)[source]

Sets the toolbar item bitmap.

Parameters:bmp – an instance of wx.Bitmap.


SetDisabledBitmap(bmp)[source]

Sets the toolbar item disabled bitmap.

Parameters:bmp – an instance of wx.Bitmap.



SetHasDropDown(b)[source]

Sets whether the toolbar item has an associated dropdown menu.

Parameters:bTrue to set a dropdown menu, False otherwise.


SetHoverBitmap(bmp)[source]

Sets the toolbar item hover bitmap.

Parameters:bmp – an instance of wx.Bitmap.



SetId(new_id)[source]

Sets the toolbar item identifier.

Parameters:new_id – the new tool id.


SetKind(new_kind)[source]

Sets the AuiToolBarItem kind.

Parameters:new_kind – can be one of the following items:


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


SetLabel(s)[source]

Sets the toolbar item label.

Parameters:s – a string specifying the toolbar item label.


SetLongHelp(s)[source]

Sets the long help string for the toolbar item. This string is shown in the statusbar (if any) of the parent frame when the mouse pointer is inside the tool.

Parameters:s – the tool long help string.


SetMinSize(s)[source]

Sets the toolbar item minimum size.

Parameters:s – an instance of wx.Size.


SetOrientation(a)[source]

Sets the toolbar tool orientation.

Parameters:a – one of AUI_TBTOOL_HORIZONTAL, AUI_TBTOOL_VERT_CLOCKWISE or AUI_TBTOOL_VERT_COUNTERCLOCKWISE.


SetProportion(p)[source]

Sets the AuiToolBarItem proportion in the toolbar.

Parameters:p – the item proportion.


SetShortHelp(s)[source]

Sets the short help string for the AuiToolBarItem, to be displayed in a wx.ToolTip when the mouse hover over the toolbar item.

Parameters:s – the tool short help string.


SetSizerItem(s)[source]

Associates a sizer item to this toolbar item.

Parameters:s – an instance of wx.SizerItem.


SetSpacerPixels(s)[source]

Sets the number of pixels for a toolbar item with kind = ITEM_SEPARATOR.

Parameters:s – number of pixels.


SetState(new_state)[source]

Sets the toolbar item state.

Parameters:new_state – can be one of the following states:


Button State Constant Description
AUI_BUTTON_STATE_NORMAL Normal button state
AUI_BUTTON_STATE_HOVER Hovered button state
AUI_BUTTON_STATE_PRESSED Pressed button state
AUI_BUTTON_STATE_DISABLED Disabled button state
AUI_BUTTON_STATE_HIDDEN Hidden button state
AUI_BUTTON_STATE_CHECKED Checked button state


SetSticky(b)[source]

Sets whether the toolbar item is sticky (permanent highlight after mouse enter) or not.

Parameters:bTrue to set the item as sticky, False otherwise.


SetUserData(l)[source]

Associates some kind of user data to the toolbar item.

Parameters:l – a Python object.

Note

The user data can be any Python object.



SetWindow(w)[source]

Assigns a window to the toolbar item.

Parameters:w – an instance of wx.Window.
Tree

Table Of Contents

Previous topic

AuiToolBarEvent

Next topic

CommandToolBarEvent