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

Method removeItem

gui/builtinViews/fittingView.py:394–417  ·  view source on GitHub ↗

Double Left Click - remove module

(self, event)

Source from the content-addressed store, hash-verified

392 event.Skip()
393
394 def removeItem(self, event):
395 """Double Left Click - remove module"""
396 if event.GetModifiers() == wx.MOD_CONTROL:
397 return
398 row, _ = self.HitTest(event.Position)
399 if row != -1 and row not in self.blanks and isinstance(self.mods[row], Module):
400 col = self.getColumn(event.Position)
401 if col != self.getColIndex(State):
402 try:
403 mod = self.mods[row]
404 except IndexError:
405 return
406 if not isinstance(mod, Module) or mod.isEmpty:
407 return
408 if event.GetModifiers() == wx.MOD_ALT:
409 fit = Fit.getInstance().getFit(self.activeFitID)
410 positions = getSimilarModPositions(fit.modules, mod)
411 self.mainFrame.command.Submit(cmd.GuiRemoveLocalModuleCommand(
412 fitID=self.activeFitID, positions=positions))
413 else:
414 self.removeModule(mod)
415 else:
416 if "wxMSW" in wx.PlatformInfo:
417 self.click(event)
418
419 def removeModule(self, modules):
420 """Removes a list of modules from the fit"""

Callers

nothing calls this directly

Calls 8

removeModuleMethod · 0.95
clickMethod · 0.95
getSimilarModPositionsFunction · 0.90
getColIndexMethod · 0.80
getFitMethod · 0.80
HitTestMethod · 0.45
getColumnMethod · 0.45
getInstanceMethod · 0.45

Tested by

no test coverage detected