Implement basic ammo switching context menu. (still needs much

polishing)
This commit is contained in:
cncfanatics
2010-10-19 10:31:52 +02:00
parent 5c653c98ae
commit bc883685ec
7 changed files with 94 additions and 5 deletions

View File

@@ -49,6 +49,10 @@ class ContextMenu(object):
item = wx.MenuItem(menu, id, text)
menu.info[id] = (m, context, it)
sub = m.getSubMenu(context, selection, menu, it)
if sub is not None:
item.SetSubMenu(sub)
if bitmap is not None:
if multiple:
bp = bitmap[it]
@@ -77,12 +81,17 @@ class ContextMenu(object):
selection = (selection,)
m.activate(context, selection, i)
else:
event.Skip()
def display(self, context, selection):
raise NotImplementedError()
def activate(self, context, selection, i):
raise NotImplementedError()
return None
def getSubMenu(self, context, selection, menu, i):
return None
def getText(self, context, selection):
raise NotImplementedError()
@@ -90,4 +99,5 @@ class ContextMenu(object):
def getBitmap(self, context, selection):
return None
from gui.builtinContextMenus import *