Package wx :: Package lib :: Package agw :: Module flatmenu :: Class FlatMenuItem

[frames | no frames]

## Class FlatMenuItem

A class that represents an item in a menu.

Method Summary
| ``__init__`(self, parent, id, text, helpString, kind, subMenu, normalBmp, disabledBmp, hotBmp)` Default class constructor.
| ``Check`(self, check)` Checks or unchecks the menu item.
| ``DrawSelf`(self, dc, xCoord, yCoord, imageMarginX, markerMarginX, textX, rightMarginX, selected)` Draws the menu item on the specified dc.
| ``Enable`(self, enable)` Enables or Disables a menu item.
| ``GetAcceleratorEntry`(self)` Returns the accelerator entry associated to this menu item.
| ``GetAccelString`(self)` Returns the accelerator string.
| ``GetBitmap`(self)` Returns the normal bitmap associated to the menu item or wx.NullBitmap if not supplied.
| ``GetContextMenu`(self)` Returns the context menu associated with this item (if any).
| ``GetDisabledBitmap`(self)` Returns the disabled bitmap associated to the menu item or wx.NullBitmap if not supplied.
| ``GetHeight`(self)` Returns the menu item height.
| ``GetHelp`(self)` Returns the item help string.
| ``GetHotBitmap`(self)` Returns the hot bitmap associated to the menu item or wx.NullBitmap if not supplied.
| ``GetId`(self)` Returns the item id.
| ``GetKind`(self)` Returns the menu item kind, can be one of wx.ITEM_SEPARATOR, wx.ITEM_NORMAL, wx.ITEM_CHECK or wx.ITEM_RADIO.
| ``GetLabel`(self)` Returns the menu item label (without the accelerator if is part of the string).
| `GetLongHelp(self)`
| ``GetMenu`(self)` Returns the parent menu.
| ``GetMnemonicChar`(self)` Returns the shortcut char for this menu item.
| ``GetRect`(self)` Returns the menu item rect.
| `GetShortHelp(self)`
| ``GetSubMenu`(self)` Returns the sub-menu.
| ``GetSuitableBitmap`(self, selected)` Gets the bitmap that should be used based on the item state.
| ``GetText`(self)` Returns the text associated with the menu item including accelerator.
| ``IsCheckable`(self)` Returns True if this item is of type wx.ITEM_CHECK, False otherwise.
| ``IsChecked`(self)` Returns whether an item is checked or not.
| ``IsEnabled`(self)` Returns whether an item is enabled or not.
| ``IsRadioItem`(self)` Returns True if this item is of type wx.ITEM_RADIO, False otherwise.
| ``IsSeparator`(self)` Returns True if this item is of type wx.ITEM_SEPARATOR, False otherwise.
| ``IsShown`(self)` Returns whether an item is shown or not.
| ``IsSubMenu`(self)` Returns whether an item is a sub-menu or not.
| ``SetContextMenu`(self, context_menu)` Assigns a context menu to this item.
| ``SetDisabledBitmap`(self, bmp)` Sets the menu item disabled bitmap.
| ``SetHelp`(self, helpString)` Sets the menu item help string.
| ``SetHotBitmap`(self, bmp)` Sets the menu item hot bitmap.
| ``SetLabel`(self, text)` Sets the label text for this item from the text (excluding the accelerator).
| `SetLongHelp(self, help)`
| ``SetMenu`(self, menu)` Sets the menu item parent menu.
| `SetMenuBar(self)`
| ``SetNormalBitmap`(self, bmp)` Sets the menu item normal bitmap.
| ``SetRect`(self, rect)` Sets the menu item rect.
| ``SetSubMenu`(self, menu)` Sets the menu item sub-menu.
| ``SetText`(self, text)` Sets the text for this menu item (including accelerators).
| ``Show`(self, show)` Actually shows the menu item.

Method Details

### __init__(self, parent, id=-2, text='', helpString='', kind=0, subMenu=None, normalBmp=<wx._gdi.Bitmap; proxy of <Swig Object of type 'wxBitmap ..., disabledBmp=<wx._gdi.Bitmap; proxy of <Swig Object of type 'wxBitmap ..., hotBmp=<wx._gdi.Bitmap; proxy of <Swig Object of type 'wxBitmap ...)
(Constructor)

Default class constructor.

Parameters:

  Parameters:
    `parent` - menu that the menu item belongs to;

    `helpString` - optional help string that will be shown on the status bar;

    `kind` - may be wx.ITEM_SEPARATOR, wx.ITEM_NORMAL, wx.ITEM_CHECK or wx.ITEM_RADIO;

    `normalBmp` - normal bitmap to draw to the side of the text, this bitmap is used when the menu is enabled;

    `disabledBmp` - 'greyed' bitmap to draw to the side of the text, this bitmap is used when the menu is disabled, if none supplied normal is used;

    `hotBmp` - hot bitmap to draw to the side of the text, this bitmap is used when the menu is hovered, if non supplied, normal is used.

### Check(self, check=True)

Checks or unchecks the menu item.

### DrawSelf(self, dc, xCoord, yCoord, imageMarginX, markerMarginX, textX, rightMarginX, selected=False)

Draws the menu item on the specified dc.

### Enable(self, enable=True)

Enables or Disables a menu item.

### GetAcceleratorEntry(self)

Returns the accelerator entry associated to this menu item.

### GetAccelString(self)

Returns the accelerator string.

### GetBitmap(self)

Returns the normal bitmap associated to the menu item or wx.NullBitmap if not supplied.

### GetContextMenu(self)

Returns the context menu associated with this item (if any).

### GetDisabledBitmap(self)

Returns the disabled bitmap associated to the menu item or wx.NullBitmap if not supplied.

### GetHeight(self)

Returns the menu item height.

### GetHelp(self)

Returns the item help string.

### GetHotBitmap(self)

Returns the hot bitmap associated to the menu item or wx.NullBitmap if not supplied.

### GetId(self)

Returns the item id.

### GetKind(self)

Returns the menu item kind, can be one of wx.ITEM_SEPARATOR, wx.ITEM_NORMAL, wx.ITEM_CHECK or wx.ITEM_RADIO.

### GetLabel(self)

Returns the menu item label (without the accelerator if is part of the string).

### GetMenu(self)

Returns the parent menu.

### GetMnemonicChar(self)

Returns the shortcut char for this menu item.

### GetRect(self)

Returns the menu item rect.

### GetSubMenu(self)

Returns the sub-menu.

### GetSuitableBitmap(self, selected)

Gets the bitmap that should be used based on the item state.

### GetText(self)

Returns the text associated with the menu item including accelerator.

### IsCheckable(self)

Returns True if this item is of type wx.ITEM_CHECK, False otherwise.

### IsChecked(self)

Returns whether an item is checked or not.

### IsEnabled(self)

Returns whether an item is enabled or not.

### IsRadioItem(self)

Returns True if this item is of type wx.ITEM_RADIO, False otherwise.

### IsSeparator(self)

Returns True if this item is of type wx.ITEM_SEPARATOR, False otherwise.

### IsShown(self)

Returns whether an item is shown or not.

### IsSubMenu(self)

Returns whether an item is a sub-menu or not.

### SetContextMenu(self, context_menu)

Assigns a context menu to this item.

### SetDisabledBitmap(self, bmp)

Sets the menu item disabled bitmap.

### SetHelp(self, helpString)

Sets the menu item help string.

### SetHotBitmap(self, bmp)

Sets the menu item hot bitmap.

### SetLabel(self, text)

Sets the label text for this item from the text (excluding the accelerator).

### SetMenu(self, menu)

Sets the menu item parent menu.

### SetNormalBitmap(self, bmp)

Sets the menu item normal bitmap.

### SetRect(self, rect)

Sets the menu item rect.

### SetSubMenu(self, menu)

Sets the menu item sub-menu.

### SetText(self, text)

Sets the text for this menu item (including accelerators).

### Show(self, show=True)

Actually shows the menu item.

Generated by Epydoc 2.1.20050511.rpd on Mon Feb 16 12:51:23 2009 | http://epydoc.sf.net