Register EVT_MENU on ALL of the submenus, not just the base

This commit is contained in:
cncfanatics
2010-10-20 19:04:04 +02:00
parent 67f55e1cb7
commit b9d3d0193f

View File

@@ -84,6 +84,7 @@ class ModuleAmmoPicker(ContextMenu):
def getSubMenu(self, context, selection, menu, i):
menu.Bind(wx.EVT_MENU, self.handleAmmoSwitch)
m = wx.Menu()
m.Bind(wx.EVT_MENU, self.handleAmmoSwitch)
self.chargeIds = {}
if self.hardpoint == Hardpoint.TURRET:
self.addSeperator(m, "Long Range")
@@ -108,6 +109,7 @@ class ModuleAmmoPicker(ContextMenu):
else:
if sub is None:
sub = wx.Menu()
sub.Bind(wx.EVT_MENU, self.handleAmmoSwitch)
self.addSeperator(sub, "Less Damage")
item.SetSubMenu(sub)
sub.AppendItem(self.addCharge(sub, base))
@@ -142,6 +144,7 @@ class ModuleAmmoPicker(ContextMenu):
item.SetBitmap(bitmap)
sub = wx.Menu()
sub.Bind(wx.EVT_MENU, self.handleAmmoSwitch)
self.addSeperator(sub, "Less Damage")
item.SetSubMenu(sub)
m.AppendItem(item)