Package Editra :: Package src :: Module ed_menu
[hide private]

Module ed_menu

source code

Provides an advanced menu class for easily creating menus and setting their related bitmaps when available from Editra's ArtProvider. The Keybinder class for managing keybindings and profiles is also provided by this module.


Author: Cody Precord <cprecord@editra.org>

Classes [hide private]
  EdMenu
Custom wxMenu class that makes it easier to customize and access items.
  KeyBinder
Class for managing keybinding configurations
  EdMenuBar
Custom menubar to allow for easier access and updating of menu components.
Functions [hide private]
 
_FindStringRep(item_id)
Find the string representation of the given id value
source code
 
_GetValueFromStr(item_str)
Get the id value from the string representation of the object
source code
 
IterateMenuItems(menu)
Recursively walk and yield menu items as the are found.
source code
 
WalkAndSetBitmaps(menu)
Recursively walk a menu and its submenus setting bitmaps as necessary/available, using the the current theme.
source code
 
WalkMenu(menu, label, collection)
Recursively walk a menu and collect all its sub items
source code
Variables [hide private]
  __svnid__ = '$Id: ed_menu.py 59989 2009-04-03 01:57:17Z CJP $'
  __revision__ = '$Revision: 59989 $'
  _DEFAULT_BINDING = {100: (u'Ctrl', u'Shift', u'N'), 102: (u'Ct...
Function Details [hide private]

_FindStringRep(item_id)

source code 

Find the string representation of the given id value

Parameters:
  • item_id - int
Returns:
string or None

_GetValueFromStr(item_str)

source code 

Get the id value from the string representation of the object

Parameters:
  • item_str - items variable string
Returns:
int or None

IterateMenuItems(menu)

source code 

Recursively walk and yield menu items as the are found. Only menu items are yielded, not submenus or separators.

Parameters:
  • menu - menu to iterate

WalkMenu(menu, label, collection)

source code 

Recursively walk a menu and collect all its sub items

Parameters:
  • menu - wxMenu to walk
  • label - the menu's label
  • collection - dictionary to collect results in
Returns:
dict {menulabel : [menu id, (item1 id, label1),]}

Variables Details [hide private]

_DEFAULT_BINDING

Value:
{100: (u'Ctrl', u'Shift', u'N'),
 102: (u'Ctrl', u'Shift', u'W'),
 109: (u'Ctrl', u'Shift', u'P'),
 110: (u'Ctrl', u'Shift', u'V'),
 111: (u'Ctrl', u'Shift', u'|'),
 115: (u'Ctrl', u'L'),
 116: (u'Ctrl', u'Shift', u'L'),
 117: (u'Ctrl', u'D'),
...