52 |
|
|
53 |
# Add a menu item (action) |
# Add a menu item (action) |
54 |
def addAction(self, name, parent, userAction): |
def addAction(self, name, parent, userAction): |
55 |
label = name |
label = altlabel = name |
56 |
hotkey = userAction.getHotKeyText() |
hotkey = userAction.getHotKeyText() |
57 |
iconloc = userAction.getIconLocation(size="16x16") |
iconloc = userAction.getIconLocation(size="16x16") |
58 |
|
|
81 |
pass |
pass |
82 |
|
|
83 |
parent.AppendItem(item) |
parent.AppendItem(item) |
|
parent.SetLabel(id, label) |
|
|
return item |
|
84 |
|
|
85 |
|
try: |
86 |
|
parent.SetLabel(id, label) |
87 |
|
except: |
88 |
|
# Some i18n installations of WX don't like our hotkeys! |
89 |
|
parent.SetLabel(id, altlabel) |
90 |
|
return item |
91 |
|
|
92 |
# Add a separator |
# Add a separator |
93 |
def addSeparator(self, parent): |
def addSeparator(self, parent): |
94 |
parent.AppendSeparator() |
parent.AppendSeparator() |
95 |
|
|
96 |
# Enable a menu item |
# Enable a menu item |
97 |
def enableItem(self, item): |
def enableItem(self, item): |
98 |
item.Enable(1) |
item.Enable(1) |
99 |
|
|
100 |
# Disable a menu item |
# Disable a menu item |
101 |
def disableItem(self, item): |
def disableItem(self, item): |
102 |
item.Enable(0) |
item.Enable(0) |
103 |
|
|
104 |
_cachedIcons = {} |
_cachedIcons = {} |