Handles dragging of items from various pyfa displays which support it data is list with two indices: data[0] is hard-coded str of originating source data[1] is typeID or index of data we want to manipulate
(self, x, y, data)
| 105 | self.refreshContents(fit) |
| 106 | |
| 107 | def handleListDrag(self, x, y, data): |
| 108 | """ |
| 109 | Handles dragging of items from various pyfa displays which support it |
| 110 | |
| 111 | data is list with two indices: |
| 112 | data[0] is hard-coded str of originating source |
| 113 | data[1] is typeID or index of data we want to manipulate |
| 114 | """ |
| 115 | fitID = self.mainFrame.getActiveFit() |
| 116 | fit = Fit.getInstance().getFit(fitID) |
| 117 | if data[0] == 'fitting': |
| 118 | dstRow, _ = self.HitTest((x, y)) |
| 119 | # Gather module information to get position |
| 120 | self.mainFrame.command.Submit(cmd.GuiAddProjectedModuleCommand( |
| 121 | fitID=fitID, itemID=fit.modules[int(data[1])].itemID)) |
| 122 | elif data[0] == 'market': |
| 123 | itemID = int(data[1]) |
| 124 | item = Market.getInstance().getItem(itemID) |
| 125 | if item.isModule: |
| 126 | self.mainFrame.command.Submit(cmd.GuiAddProjectedModuleCommand(fitID=fitID, itemID=itemID)) |
| 127 | elif item.isDrone: |
| 128 | self.mainFrame.command.Submit(cmd.GuiAddProjectedDroneCommand(fitID=fitID, itemID=itemID)) |
| 129 | elif item.isFighter: |
| 130 | self.mainFrame.command.Submit(cmd.GuiAddProjectedFighterCommand(fitID=fitID, itemID=itemID)) |
| 131 | |
| 132 | def kbEvent(self, event): |
| 133 | keycode = event.GetKeyCode() |
nothing calls this directly
no test coverage detected