Phoenix Logo

phoenix_title wx.lib.agw.flatmenu.FlatToolbarItem

This class represents a toolbar item.


class_hierarchy Class Hierarchy

Inheritance diagram for class FlatToolbarItem:


method_summary Methods Summary

__init__ Default class constructor.
Enable Enables or disables the tool.
GetBitmap Returns the tool bitmap.
GetCustomControl Returns the associated custom control.
GetDisabledBitmap Returns the tool disabled bitmap.
GetGroup Returns group id for radio item, or -1 for other item types.
GetId Gets the tool id.
GetLabel Returns the tool label.
GetLongHelp Returns the tool long help string (displayed in the parent frame StatusBar).
GetShortHelp Returns the tool short help string (displayed in the tool’s tooltip).
IsChecked Same as IsSelected. More intuitive for check items though.
IsCheckItem Returns True if the item is a radio item.
IsCustomControl Returns whether the tool is a custom control or not.
IsEnabled Returns whether the tool is enabled or not.
IsRadioItem Returns True if the item is a radio item.
IsRegularItem Returns whether the tool is a standard tool or not.
IsSelected Returns whether the tool is selected or checked.
IsSeparator Returns whether the tool is a separator or not.
Select Selects or checks a radio or check item.
SetBitmap Sets the tool bitmap.
SetDisabledBitmap Sets the tool disabled bitmap.
SetGroup Sets group id for a radio item, for other items does nothing.
SetLabel Sets the tool label.
SetLongHelp Sets the tool long help string (displayed in the parent frame StatusBar).
SetShortHelp Sets the tool short help string (displayed in the tool’s tooltip).
Toggle Toggles a check item.

api Class API



class FlatToolbarItem(object)

This class represents a toolbar item.


Methods



__init__(self, controlType=None, id=wx.ID_ANY, label="", disabledBmp=wx.NullBitmap, kind=wx.ITEM_NORMAL, shortHelp="", longHelp="")

Default class constructor.

Parameters:
  • controlType – can be None for a toolbar separator, an instance of wx.Window for a control or an instance of wx.Bitmap for a standard toolbar tool;
  • id (integer) – the toolbar tool id. If set to wx.ID_ANY, a new id is automatically assigned;
  • label (string) – the toolbar tool label;
  • disabledBmp – the bitmap used when the tool is disabled. If the tool is a standard one (i.e., not a control or a separator), and disabledBmp is equal to NullBitmap, the disabled bitmap is automatically generated by greing the normal one;
  • kind (integer) – may be wx.ITEM_NORMAL for a normal button (default), wx.ITEM_CHECK for a checkable tool (such tool stays pressed after it had been toggled) or wx.ITEM_RADIO for a checkable tool which makes part of a radio group of tools each of which is automatically unchecked whenever another button in the group is checked;
  • shortHelp (string) – a string used for the tool’s tooltip;
  • longHelp (string) – this string is shown in the StatusBar (if any) of the parent frame when the mouse pointer is inside the tool.


Enable(self, enable=True)

Enables or disables the tool.

Parameters:enable (bool) – True to enable the tool, False to disable it.


GetBitmap(self)

Returns the tool bitmap.



GetCustomControl(self)

Returns the associated custom control.



GetDisabledBitmap(self)

Returns the tool disabled bitmap.



GetGroup(self)

Returns group id for radio item, or -1 for other item types.



GetId(self)

Gets the tool id.



GetLabel(self)

Returns the tool label.



GetLongHelp(self)

Returns the tool long help string (displayed in the parent frame StatusBar).



GetShortHelp(self)

Returns the tool short help string (displayed in the tool’s tooltip).



IsChecked(self)

Same as IsSelected. More intuitive for check items though.



IsCheckItem(self)

Returns True if the item is a radio item.



IsCustomControl(self)

Returns whether the tool is a custom control or not.



IsEnabled(self)

Returns whether the tool is enabled or not.



IsRadioItem(self)

Returns True if the item is a radio item.



IsRegularItem(self)

Returns whether the tool is a standard tool or not.



IsSelected(self)

Returns whether the tool is selected or checked.



IsSeparator(self)

Returns whether the tool is a separator or not.



Select(self, select=True)

Selects or checks a radio or check item.

Parameters:select (bool) – True to select or check a tool, False to unselect or uncheck it.


SetBitmap(self, bmp)

Sets the tool bitmap.

Parameters:bmp – the new tool bitmap, a valid wx.Bitmap object.


SetDisabledBitmap(self, bmp)

Sets the tool disabled bitmap.

Parameters:bmp – the new tool disabled bitmap, a valid wx.Bitmap object.


SetGroup(self, group)

Sets group id for a radio item, for other items does nothing.

Parameters:group – an instance of FlatMenuItemGroup.


SetLabel(self, label)

Sets the tool label.

Parameters:label (string) – the new tool string.


SetLongHelp(self, help)

Sets the tool long help string (displayed in the parent frame StatusBar).

Parameters:help (string) – the new tool long help string.


SetShortHelp(self, help)

Sets the tool short help string (displayed in the tool’s tooltip).

Parameters:help (string) – the new tool short help string.


Toggle(self)

Toggles a check item.