Implement basic ammo switching context menu. (still needs much
polishing)
This commit is contained in:
@@ -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 *
|
||||
|
||||
Reference in New Issue
Block a user