AGW Logo

agw_title FlatToolbarItem

This class represents a toolbar item.

hierarchy Inheritance Diagram

Inheritance diagram for: FlatToolbarItem

Inheritance diagram of FlatToolbarItem


method_summary Methods Summary

__init__Default class constructor.
EnableEnables or disables the tool.
GetBitmapReturns the tool bitmap.
GetCustomControlReturns the associated custom control.
GetDisabledBitmapReturns the tool disabled bitmap.
GetGroupReturns group id for radio item, or -1 for other item types.
GetIdGets the tool id.
GetLabelReturns the tool label.
GetLongHelpReturns the tool long help string (displayed in the parent frame wx.StatusBar).
GetShortHelpReturns the tool short help string (displayed in the tool’s tooltip).
IsCheckItemReturns True if the item is a radio item.
IsCheckedSame as IsSelected. More intuitive for check items though.
IsCustomControlReturns whether the tool is a custom control or not.
IsEnabledReturns whether the tool is enabled or not.
IsRadioItemReturns True if the item is a radio item.
IsRegularItemReturns whether the tool is a standard tool or not.
IsSelectedReturns whether the tool is selected or checked.
IsSeparatorReturns whether the tool is a separator or not.
SelectSelects or checks a radio or check item.
SetBitmapSets the tool bitmap.
SetDisabledBitmapSets the tool disabled bitmap.
SetGroupSets group id for a radio item, for other items does nothing.
SetLabelSets the tool label.
SetLongHelpSets the tool long help string (displayed in the parent frame wx.StatusBar).
SetShortHelpSets the tool short help string (displayed in the tool’s tooltip).
ToggleToggles a check item.

API Class API

class FlatToolbarItem(object)[source]

This class represents a toolbar item.



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

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 wx.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 wx.StatusBar (if any) of the parent frame when the mouse pointer is inside the tool.



Enable(enable=True)[source]

Enables or disables the tool.

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


GetBitmap()[source]

Returns the tool bitmap.



GetCustomControl()[source]

Returns the associated custom control.



GetDisabledBitmap()[source]

Returns the tool disabled bitmap.



GetGroup()[source]

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



GetId()[source]

Gets the tool id.



GetLabel()[source]

Returns the tool label.



GetLongHelp()[source]

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



GetShortHelp()[source]

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



IsCheckItem()[source]

Returns True if the item is a radio item.



IsChecked()[source]

Same as IsSelected. More intuitive for check items though.



IsCustomControl()[source]

Returns whether the tool is a custom control or not.



IsEnabled()[source]

Returns whether the tool is enabled or not.



IsRadioItem()[source]

Returns True if the item is a radio item.



IsRegularItem()[source]

Returns whether the tool is a standard tool or not.



IsSelected()[source]

Returns whether the tool is selected or checked.



IsSeparator()[source]

Returns whether the tool is a separator or not.



Select(select=True)[source]

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(bmp)[source]

Sets the tool bitmap.

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



SetDisabledBitmap(bmp)[source]

Sets the tool disabled bitmap.

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



SetGroup(group)[source]

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

Parameters:group – an instance of FlatMenuItemGroup.


SetLabel(label)[source]

Sets the tool label.

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


SetLongHelp(help)[source]

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

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


SetShortHelp(help)[source]

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

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


Toggle()[source]

Toggles a check item.

Tree

Table Of Contents

Previous topic

FlatMenuItemGroup

Next topic

FocusHandler