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

Method click

gui/builtinAdditionPanes/boosterView.py:176–203  ·  view source on GitHub ↗
(self, event)

Source from the content-addressed store, hash-verified

174 self.mainFrame.command.Submit(cmd.GuiRemoveBoostersCommand(fitID=fitID, positions=positions))
175
176 def click(self, event):
177 mainRow, _ = self.HitTest(event.Position)
178 if mainRow != -1:
179 col = self.getColumn(event.Position)
180 if col == self.getColIndex(State):
181 fitID = self.mainFrame.getActiveFit()
182 try:
183 mainBooster = self.boosters[mainRow]
184 except IndexError:
185 return
186 if mainBooster in self.original:
187 mainPosition = self.original.index(mainBooster)
188 positions = []
189 for row in self.getSelectedRows():
190 try:
191 booster = self.boosters[row]
192 except IndexError:
193 continue
194 if booster in self.original:
195 positions.append(self.original.index(booster))
196 if mainPosition not in positions:
197 positions = [mainPosition]
198 self.mainFrame.command.Submit(cmd.GuiToggleBoosterStatesCommand(
199 fitID=fitID,
200 mainPosition=mainPosition,
201 positions=positions))
202 return
203 event.Skip()
204
205 def spawnMenu(self, event):
206 clickedPos = self.getRowByAbs(event.Position)

Callers

nothing calls this directly

Calls 6

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

Tested by

no test coverage detected