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

Method click

gui/builtinAdditionPanes/implantView.py:257–287  ·  view source on GitHub ↗
(self, event)

Source from the content-addressed store, hash-verified

255 self.mainFrame.command.Submit(cmd.GuiRemoveImplantsCommand(fitID=fitID, positions=positions))
256
257 def click(self, event):
258 fitID = self.mainFrame.getActiveFit()
259 fit = Fit.getInstance().getFit(fitID)
260 if fit.implantLocation == ImplantLocation.FIT:
261 mainRow, _ = self.HitTest(event.Position)
262 if mainRow != -1:
263 col = self.getColumn(event.Position)
264 if col == self.getColIndex(State):
265 fitID = self.mainFrame.getActiveFit()
266 try:
267 mainImplant = self.implants[mainRow]
268 except IndexError:
269 return
270 if mainImplant in self.original:
271 mainPosition = self.original.index(mainImplant)
272 positions = []
273 for row in self.getSelectedRows():
274 try:
275 implant = self.implants[row]
276 except IndexError:
277 continue
278 if implant in self.original:
279 positions.append(self.original.index(implant))
280 if mainPosition not in positions:
281 positions = [mainPosition]
282 self.mainFrame.command.Submit(cmd.GuiToggleImplantStatesCommand(
283 fitID=fitID,
284 mainPosition=mainPosition,
285 positions=positions))
286 return
287 event.Skip()
288
289 def spawnMenu(self, event):
290 clickedPos = self.getRowByAbs(event.Position)

Callers

nothing calls this directly

Calls 8

getFitMethod · 0.80
getColIndexMethod · 0.80
getSelectedRowsMethod · 0.80
getActiveFitMethod · 0.45
getInstanceMethod · 0.45
HitTestMethod · 0.45
getColumnMethod · 0.45
appendMethod · 0.45

Tested by

no test coverage detected