wx.lib.agw.aui.auibar.AuiToolBarItem¶
AuiToolBarItem is a toolbar element.
It has a unique id (except for the separators which always have id = -1 and the automatically added restore-from-minimize which always have id = ID_RESTORE_FRAME), 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.
Class Hierarchy¶
Methods Summary¶
Default class constructor. |
|
Assigns the properties of the |
|
Returns the toolbar item alignment. |
|
Returns the toolbar item bitmap. |
|
Returns the toolbar item disabled bitmap. |
|
Returns the toolbar item hover bitmap. |
|
Returns the toolbar item identifier. |
|
Returns the toolbar item kind. |
|
Returns the toolbar item label. |
|
Returns the long help string for the |
|
Returns the toolbar item minimum size. |
|
Returns the toolbar tool orientation. |
|
Returns the |
|
Returns the correct bitmap depending on the tool orientation. |
|
Returns the short help string for the |
|
Returns the associated sizer item. |
|
Returns the number of pixels for a toolbar item with kind = |
|
Returns the toolbar item state. |
|
Returns the associated user data. |
|
Returns window associated to the toolbar item. |
|
Returns whether the toolbar item has an associated dropdown menu or not. |
|
Returns whether the toolbar item is active or not. |
|
Returns whether the toolbar item has a sticky behaviour or not. |
|
Activates/deactivates the toolbar item. |
|
Sets the toolbar item alignment. |
|
Sets the toolbar item bitmap. |
|
Sets the toolbar item disabled bitmap. |
|
Sets whether the toolbar item has an associated dropdown menu. |
|
Sets the toolbar item hover bitmap. |
|
Sets the toolbar item identifier. |
|
Sets the |
|
Sets the toolbar item label. |
|
Sets the long help string for the toolbar item. This string is shown in the |
|
Sets the toolbar item minimum size. |
|
Sets the toolbar tool orientation. |
|
Sets the |
|
Sets the short help string for the |
|
Associates a sizer item to this toolbar item. |
|
Sets the number of pixels for a toolbar item with kind = |
|
Sets the toolbar item state. |
|
Sets whether the toolbar item is sticky (permanent highlight after mouse enter) |
|
Associates some kind of user data to the toolbar item. |
|
Assigns a window to the toolbar item. |
Class API¶
- class AuiToolBarItem(object)¶
AuiToolBarItem is a toolbar element.
It has a unique id (except for the separators which always have id = -1 and the automatically added restore-from-minimize which always have id = ID_RESTORE_FRAME), 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.
Methods¶
- __init__(self, item=None)¶
Default class constructor.
- Parameters:
item – another instance of
AuiToolBarItem
.
- Assign(self, c)¶
Assigns the properties of the
AuiToolBarItem
c to self.- Parameters:
c – another instance of
AuiToolBarItem
.
- GetAlignment(self)¶
Returns the toolbar item alignment.
- GetBitmap(self)¶
Returns the toolbar item bitmap.
- GetDisabledBitmap(self)¶
Returns the toolbar item disabled bitmap.
- GetHoverBitmap(self)¶
Returns the toolbar item hover bitmap.
- GetId(self)¶
Returns the toolbar item identifier.
- GetLabel(self)¶
Returns the toolbar item label.
- GetLongHelp(self)¶
Returns the long help string for the
AuiToolBarItem
.
- GetMinSize(self)¶
Returns the toolbar item minimum size.
- GetOrientation(self)¶
Returns the toolbar tool orientation.
- GetProportion(self)¶
Returns the
AuiToolBarItem
proportion in the toolbar.
- GetRotatedBitmap(self, disabled)¶
Returns the correct bitmap depending on the tool orientation.
- Parameters:
disabled (bool) – whether to return the disabled bitmap or not.
- GetShortHelp(self)¶
Returns the short help string for the
AuiToolBarItem
.
- GetSizerItem(self)¶
Returns the associated sizer item.
- GetSpacerPixels(self)¶
Returns the number of pixels for a toolbar item with kind =
ITEM_SEPARATOR
.
- GetUserData(self)¶
Returns the associated user data.
- GetWindow(self)¶
Returns window associated to the toolbar item.
- HasDropDown(self)¶
Returns whether the toolbar item has an associated dropdown menu or not.
- IsActive(self)¶
Returns whether the toolbar item is active or not.
- IsSticky(self)¶
Returns whether the toolbar item has a sticky behaviour or not.
- SetActive(self, b)¶
Activates/deactivates the toolbar item.
- Parameters:
b (bool) –
True
to activate the item,False
to deactivate it.
- SetAlignment(self, align)¶
Sets the toolbar item alignment.
- Parameters:
align (integer) – the item alignment, which can be one of the available
wx.Sizer
alignments.
- SetBitmap(self, bmp)¶
Sets the toolbar item bitmap.
- Parameters:
bmp (wx.Bitmap) – the image associated with this
AuiToolBarItem
.
- SetDisabledBitmap(self, bmp)¶
Sets the toolbar item disabled bitmap.
- Parameters:
bmp (wx.Bitmap) – the disabled image associated with this
AuiToolBarItem
.
- SetHasDropDown(self, b)¶
Sets whether the toolbar item has an associated dropdown menu.
- Parameters:
b (bool) –
True
to set a dropdown menu,False
otherwise.
- SetHoverBitmap(self, bmp)¶
Sets the toolbar item hover bitmap.
- Parameters:
bmp (wx.Bitmap) – the hover image associated with this
AuiToolBarItem
.
- SetId(self, new_id)¶
Sets the toolbar item identifier.
- Parameters:
new_id (integer) – the new tool id.
- SetKind(self, new_kind)¶
Sets the
AuiToolBarItem
kind.- Parameters:
new_kind (integer) – can be one of the following items:
Item Kind
Description
ITEM_CONTROL
The item in the
AuiToolBar
is a controlITEM_LABEL
The item in the
AuiToolBar
is a text labelITEM_SPACER
The item in the
AuiToolBar
is a spacerITEM_SEPARATOR
The item in the
AuiToolBar
is a separatorITEM_CHECK
The item in the
AuiToolBar
is a toolbar check itemITEM_NORMAL
The item in the
AuiToolBar
is a standard toolbar itemITEM_RADIO
The item in the
AuiToolBar
is a toolbar radio item
- SetLabel(self, s)¶
Sets the toolbar item label.
- Parameters:
s (string) – the toolbar item label.
- SetLongHelp(self, s)¶
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 (string) – the tool long help string.
- SetMinSize(self, s)¶
Sets the toolbar item minimum size.
- Parameters:
s (wx.Size) – the toolbar item minimum size.
- SetOrientation(self, a)¶
Sets the toolbar tool orientation.
- Parameters:
a (integer) – one of
AUI_TBTOOL_HORIZONTAL
,AUI_TBTOOL_VERT_CLOCKWISE
orAUI_TBTOOL_VERT_COUNTERCLOCKWISE
.
- SetProportion(self, p)¶
Sets the
AuiToolBarItem
proportion in the toolbar.- Parameters:
p (integer) – the item proportion.
- SetShortHelp(self, s)¶
Sets the short help string for the
AuiToolBarItem
, to be displayed in aToolTip
when the mouse hover over the toolbar item.- Parameters:
s (string) – the tool short help string.
- SetSizerItem(self, s)¶
Associates a sizer item to this toolbar item.
- Parameters:
s – an instance of
wx.SizerItem
.
- SetSpacerPixels(self, s)¶
Sets the number of pixels for a toolbar item with kind =
ITEM_SEPARATOR
.- Parameters:
s (integer) – number of pixels.
- SetState(self, new_state)¶
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(self, b)¶
Sets whether the toolbar item is sticky (permanent highlight after mouse enter) or not.
- Parameters:
b (bool) –
True
to set the item as sticky,False
otherwise.
- SetUserData(self, data)¶
Associates some kind of user data to the toolbar item.
- Parameters:
data (PyObject) – a Python object.
Note
The user data can be any Python object.
- SetWindow(self, w)¶
Assigns a window to the toolbar item.
- Parameters:
w (wx.Window) – associate this window w to the
AuiToolBarItem
.