MCPcopy Create free account
hub / github.com/pyfa-org/Pyfa / spawnMenu

Method spawnMenu

gui/builtinItemStatsViews/itemAffectedBy.py:91–108  ·  view source on GitHub ↗
(self, event)

Source from the content-addressed store, hash-verified

89 self.affectedBy.Bind(wx.EVT_CONTEXT_MENU, self.spawnMenu)
90
91 def spawnMenu(self, event):
92 item, _ = self.affectedBy.HitTest(self.ScreenToClient(event.Position))
93 self.affectedBy.SelectItem(item)
94
95 stuff = self.affectedBy.GetItemData(item)
96 # String is set as data when we are dealing with attributes, not stuff containers
97 if stuff is None or isinstance(stuff, str):
98 return
99 contexts = []
100
101 # Skills are different in that they don't have itemModifiedAttributes,
102 # which is needed if we send the container to itemStats dialog. So
103 # instead, we send the item.
104 type_ = stuff.__class__.__name__
105 contexts.append(("itemStats", type_))
106 stuff = stuff if type_ != "Skill" else stuff.item
107 menu = ContextMenu.getMenu(self, stuff, (stuff,), *contexts)
108 self.PopupMenu(menu)
109
110 def ExpandCollapseTree(self):
111

Callers

nothing calls this directly

Calls 3

getMenuMethod · 0.80
HitTestMethod · 0.45
appendMethod · 0.45

Tested by

no test coverage detected