Example #1
0
    def handleListDrag(self, x, y, data):
        """
        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
        """
        sFit = Fit.getInstance()
        fitID = self.mainFrame.getActiveFit()
        fit = sFit.getFit(self.mainFrame.getActiveFit())

        if data[0] == "projected":
            # if source is coming from projected, we are trying to combine drones.
            pass
            # removing merge functionality - if people complain about it, can add it back as a command
            # self.mergeDrones(x, y, int(data[1]))
        elif data[0] == "fitting":
            dstRow, _ = self.HitTest((x, y))
            # Gather module information to get position
            module = fit.modules[int(data[1])]
            self.mainFrame.command.Submit(
                cmd.GuiAddProjectedCommand(fitID, module.itemID, 'item'))
            # sFit.project(fit.ID, module)
            # wx.PostEvent(self.mainFrame, GE.FitChanged(fitID=fit.ID))
        elif data[0] == "market":
            # sFit = Fit.getInstance()
            self.mainFrame.command.Submit(
                cmd.GuiAddProjectedCommand(fitID, int(data[1]), 'item'))
Example #2
0
 def handleDrag(self, type, fitID):
     # Those are drags coming from pyfa sources, NOT builtin wx drags
     if type == "fit":
         activeFit = self.mainFrame.getActiveFit()
         if activeFit:
             self.mainFrame.command.Submit(
                 cmd.GuiAddProjectedCommand(activeFit, fitID, 'fit'))
Example #3
0
 def OnProjectToFit(self, event):
     activeFit = self.mainFrame.getActiveFit()
     if activeFit:
         sFit = Fit.getInstance()
         projectedFit = sFit.getFit(self.fitID)
         if self.mainFrame.command.Submit(
                 cmd.GuiAddProjectedCommand(activeFit, projectedFit.ID,
                                            'fit')):
             self.mainFrame.additionsPane.select("Projected")
Example #4
0
    def handleSelection(self, event):
        # Skip events ids that aren't mapped

        swObj, swName = self.idmap.get(event.Id, (False, False))
        if not swObj and not swName:
            event.Skip()
            return

        fitID = self.mainFrame.getActiveFit()
        self.mainFrame.command.Submit(cmd.GuiAddProjectedCommand(fitID, swObj.ID, 'item'))
Example #5
0
    def handleSelection(self, event):
        fitID = self.mainFrame.getActiveFit()

        fit = self.fitLookup[event.Id]

        if self.context == 'commandView':
            self.mainFrame.command.Submit(
                cmd.GuiAddCommandCommand(fitID, fit.ID))
        elif self.context == 'projected':
            self.mainFrame.command.Submit(
                cmd.GuiAddProjectedCommand(fitID, fit.ID, 'fit'))
Example #6
0
 def activate(self, fullContext, selection, i):
     fitID = self.mainFrame.getActiveFit()
     self.mainFrame.command.Submit(
         cmd.GuiAddProjectedCommand(fitID, selection[0].ID, 'item'))