MCPcopy Index your code
hub / github.com/pyfa-org/Pyfa / _addCharge

Method _addCharge

gui/builtinContextMenus/moduleAmmoChange.py:71–82  ·  view source on GitHub ↗
(self, menu, charge)

Source from the content-addressed store, hash-verified

69 return self.loadableChargesCache[mod.itemID]
70
71 def _addCharge(self, menu, charge):
72 id_ = ContextMenuCombined.nextID()
73 name = charge.name if charge is not None else _t('Empty')
74 self.chargeEventMap[id_] = charge
75 item = wx.MenuItem(menu, id_, name)
76 menu.Bind(wx.EVT_MENU, self.handleAmmoSwitch, item)
77 item.charge = charge
78 if charge is not None and charge.iconID is not None:
79 bitmap = BitmapLoader.getBitmap(charge.iconID, 'icons')
80 if bitmap is not None:
81 item.SetBitmap(bitmap)
82 return item
83
84 @staticmethod
85 def _addSeparator(m, text):

Callers 1

getSubMenuMethod · 0.95

Calls 4

nextIDMethod · 0.80
SetBitmapMethod · 0.80
_tFunction · 0.50
getBitmapMethod · 0.45

Tested by

no test coverage detected