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

Method click

gui/builtinAdditionPanes/droneView.py:292–318  ·  view source on GitHub ↗
(self, event)

Source from the content-addressed store, hash-verified

290 fitID=fitID, positions=positions, amount=math.inf))
291
292 def click(self, event):
293 mainRow, _ = self.HitTest(event.Position)
294 if mainRow != -1:
295 col = self.getColumn(event.Position)
296 if col == self.getColIndex(State):
297 try:
298 mainDrone = self.drones[mainRow]
299 except IndexError:
300 return
301 if mainDrone in self.original:
302 mainPosition = self.original.index(mainDrone)
303 positions = []
304 for row in self.getSelectedRows():
305 try:
306 drone = self.drones[row]
307 except IndexError:
308 continue
309 if drone in self.original:
310 positions.append(self.original.index(drone))
311 if mainPosition not in positions:
312 positions = [mainPosition]
313 self.mainFrame.command.Submit(cmd.GuiToggleLocalDroneStatesCommand(
314 fitID=self.mainFrame.getActiveFit(),
315 mainPosition=mainPosition,
316 positions=positions))
317 return
318 event.Skip()
319
320 def spawnMenu(self, event):
321 clickedPos = self.getRowByAbs(event.Position)

Callers

nothing calls this directly

Calls 6

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

Tested by

no test coverage detected