phoenix_title 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), 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 Class Hierarchy

Inheritance diagram for class AuiToolBarItem:

method_summary Methods Summary

__init__

Default class constructor.

Assign

Assigns the properties of the AuiToolBarItem c to self.

GetAlignment

Returns the toolbar item alignment.

GetBitmap

Returns the toolbar item bitmap.

GetDisabledBitmap

Returns the toolbar item disabled bitmap.

GetHoverBitmap

Returns the toolbar item hover bitmap.

GetId

Returns the toolbar item identifier.

GetKind

Returns the toolbar item kind.

GetLabel

Returns the toolbar item label.

GetLongHelp

Returns the long help string for the AuiToolBarItem.

GetMinSize

Returns the toolbar item minimum size.

GetOrientation

Returns the toolbar tool orientation.

GetProportion

Returns the AuiToolBarItem proportion in the toolbar.

GetRotatedBitmap

Returns the correct bitmap depending on the tool orientation.

GetShortHelp

Returns the short help string for the AuiToolBarItem.

GetSizerItem

Returns the associated sizer item.

GetSpacerPixels

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

GetState

Returns the toolbar item state.

GetUserData

Returns the associated user data.

GetWindow

Returns window associated to the toolbar item.

HasDropDown

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

IsActive

Returns whether the toolbar item is active or not.

IsSticky

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

SetActive

Activates/deactivates the toolbar item.

SetAlignment

Sets the toolbar item alignment.

SetBitmap

Sets the toolbar item bitmap.

SetDisabledBitmap

Sets the toolbar item disabled bitmap.

SetHasDropDown

Sets whether the toolbar item has an associated dropdown menu.

SetHoverBitmap

Sets the toolbar item hover bitmap.

SetId

Sets the toolbar item identifier.

SetKind

Sets the AuiToolBarItem kind.

SetLabel

Sets the toolbar item label.

SetLongHelp

Sets the long help string for the toolbar item. This string is shown in the

SetMinSize

Sets the toolbar item minimum size.

SetOrientation

Sets the toolbar tool orientation.

SetProportion

Sets the AuiToolBarItem proportion in the toolbar.

SetShortHelp

Sets the short help string for the AuiToolBarItem, to be displayed in a

SetSizerItem

Associates a sizer item to this toolbar item.

SetSpacerPixels

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

SetState

Sets the toolbar item state.

SetSticky

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

SetUserData

Associates some kind of user data to the toolbar item.

SetWindow

Assigns a window to the toolbar item.


api Class API

class AuiToolBarItem(object)

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.


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.



GetKind(self)

Returns the toolbar item kind.

See SetKind for more details.



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.



GetState(self)

Returns the toolbar item state.

See also

SetState for more details.



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 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(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 or AUI_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 a ToolTip 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.