Double Left Click - remove module
(self, event)
| 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""" |
nothing calls this directly
no test coverage detected