示例#1
0
 def __init__(self, parent):
     StatsView.__init__(self)
     self.parent = parent
     self._cachedValues = []
     self.showEffective = True
     self.activeFit = None
     self.mainFrame = gui.mainFrame.MainFrame.getInstance()
     self.mainFrame.Bind(EFFECTIVE_HP_TOGGLED, self.ehpSwitch)
示例#2
0
 def __init__(self, parent):
     StatsView.__init__(self)
     self.parent = parent
     self._cachedValues = []
     self.showEffective = True
     self.activeFit = None
     self.mainFrame = gui.mainFrame.MainFrame.getInstance()
     self.mainFrame.Bind(EFFECTIVE_HP_TOGGLED, self.ehpSwitch)
示例#3
0
 def __init__(self, parent):
     StatsView.__init__(self)
     self.parent = parent
     self._timerId = wx.NewId()
     self._timer = None
     self.parent.Bind(wx.EVT_TIMER, self.OnTimer)
     self._timerRunsBeforeUpdate = 60
     self._timerRuns = 0
     self._timerIdUpdate = wx.NewId()
     self._timerUpdate = None
     self._cachedShip = 0
     self._cachedFittings = 0
     self._cachedTotal = 0
示例#4
0
 def __init__(self, parent):
     StatsView.__init__(self)
     self.parent = parent
     self._timerId = wx.NewId()
     self._timer = None
     self.parent.Bind(wx.EVT_TIMER, self.OnTimer)
     self._timerRunsBeforeUpdate = 60
     self._timerRuns = 0
     self._timerIdUpdate = wx.NewId()
     self._timerUpdate = None
     self._cachedShip = 0
     self._cachedFittings = 0
     self._cachedTotal = 0
示例#5
0
    def switchToMiningYieldView(self, event):
        # Getting the active fit
        mainFrame = gui.mainFrame.MainFrame.getInstance()
        sFit = Fit.getInstance()
        fit = sFit.getFit(mainFrame.getActiveFit())
        # Remove ourselves from statsPane's view list
        self.parent.views.remove(self)
        self._cachedValues = []
        # And no longer display us
        self.panel.GetSizer().Clear(True)
        self.panel.GetSizer().Layout()

        # Remove effective label
        hsizer = self.headerPanel.Parent.GetHeaderContentSizer()
        for i, c in enumerate(hsizer.Children):
            if c.GetWindow() is self.stEff:
                hsizer.Remove(i)
                self.stEff.Destroy()
                break

        # Get the new view
        view = StatsView.getView("miningyieldViewFull")(self.parent)
        view.populatePanel(self.panel, self.headerPanel)
        # Populate us in statsPane's view list
        self.parent.views.append(view)
        # Get the TogglePanel
        tp = self.panel.GetParent()
        tp.SetLabel(view.getHeaderText(fit))
        view.refreshPanel(fit)
示例#6
0
    def switchToMiningYieldView(self, event):
        # Getting the active fit
        mainFrame = gui.mainFrame.MainFrame.getInstance()
        sFit = service.Fit.getInstance()
        fit = sFit.getFit(mainFrame.getActiveFit())
        # Remove ourselves from statsPane's view list
        self.parent.views.remove(self)
        self._cachedValues = []
        # And no longer display us
        self.panel.GetSizer().Clear(True)
        self.panel.GetSizer().Layout()

        # Remove effective label
        hsizer = self.headerPanel.GetSizer()
        hsizer.Remove(self.stEff)
        self.stEff.Destroy()

        # Get the new view
        view = StatsView.getView("miningyieldViewFull")(self.parent)
        view.populatePanel(self.panel, self.headerPanel)
        # Populate us in statsPane's view list
        self.parent.views.append(view)
        # Get the TogglePanel
        tp = self.panel.GetParent()
        tp.SetLabel(view.getHeaderText(fit))
        view.refreshPanel(fit)
示例#7
0
    def __init__(self, parent):
        wx.Panel.__init__(self, parent)

        # Use 25% smaller fonts if MAC or force font size to 8 for msw/linux

        if "__WXMAC__" in wx.PlatformInfo:
            self.SetWindowVariant(wx.WINDOW_VARIANT_SMALL)
        else:
            standardFont = wx.SystemSettings.GetFont(wx.SYS_DEFAULT_GUI_FONT)
            standardFont.SetPointSize(8)
            self.SetFont(standardFont)

        mainSizer = wx.BoxSizer(wx.VERTICAL)
        self.SetSizer(mainSizer)

        self.views = []
        self.nameViewMap = {}
        maxviews = len(self.DEFAULT_VIEWS)
        i = 0
        for viewName in self.DEFAULT_VIEWS:
            tp = TogglePanel(self)
            contentPanel = tp.GetContentPane()
            contentPanel.viewName = viewName

            try:
                view = StatsView.getView(viewName)(self)
                pyfalog.debug("Load view: {0}", viewName)
            except KeyError:
                pyfalog.error("Attempted to load an invalid view: {0}",
                              viewName)

            self.nameViewMap[viewName] = view
            self.views.append(view)

            headerPanel = tp.GetHeaderPanel()

            view.populatePanel(contentPanel, headerPanel)
            tp.SetLabel(view.getHeaderText(None))
            view.refreshPanel(None)

            contentPanel.Bind(wx.EVT_RIGHT_DOWN,
                              self.contextHandler(contentPanel))
            for child in contentPanel.GetChildren():
                child.Bind(wx.EVT_RIGHT_DOWN,
                           self.contextHandler(contentPanel))

            mainSizer.Add(tp, 0, wx.EXPAND | wx.LEFT, 3)
            if i < maxviews - 1:
                mainSizer.Add(
                    wx.StaticLine(self, wx.ID_ANY, style=wx.HORIZONTAL), 0,
                    wx.EXPAND | wx.TOP | wx.LEFT | wx.RIGHT, 2)
            i += 1
            tp.OnStateChange(tp.GetBestSize())

        width, height = self.GetSize()
        self.SetMinSize((width + 9, -1))

        self.mainFrame = gui.mainFrame.MainFrame.getInstance()
        self.mainFrame.Bind(GE.FIT_CHANGED, self.fitChanged)
示例#8
0
文件: statsPane.py 项目: copyliu/Pyfa
    def __init__(self, parent):
        wx.Panel.__init__(self, parent)

        # Use 25% smaller fonts if MAC or force font size to 8 for msw/linux

        if "__WXMAC__" in wx.PlatformInfo:
            self.SetWindowVariant(wx.WINDOW_VARIANT_SMALL)
        else:
            standardFont = wx.SystemSettings.GetFont(wx.SYS_DEFAULT_GUI_FONT)
            standardFont.SetPointSize(8)
            self.SetFont(standardFont)

        mainSizer = wx.BoxSizer(wx.VERTICAL)
        self.SetSizer(mainSizer)

        self.views = []
        self.nameViewMap = {}
        maxviews = len(self.DEFAULT_VIEWS)
        i = 0
        for viewName in self.DEFAULT_VIEWS:
            tp = TogglePanel(self)
            contentPanel = tp.GetContentPane()
            contentPanel.viewName = viewName

            try:
                view = StatsView.getView(viewName)(self)
                pyfalog.debug("Load view: {0}", viewName)
            except KeyError:
                pyfalog.error("Attempted to load an invalid view: {0}", viewName)

            self.nameViewMap[viewName] = view
            self.views.append(view)

            headerPanel = tp.GetHeaderPanel()

            view.populatePanel(contentPanel, headerPanel)
            tp.SetLabel(view.getHeaderText(None))
            view.refreshPanel(None)

            contentPanel.Bind(wx.EVT_RIGHT_DOWN, self.contextHandler(contentPanel))
            for child in contentPanel.GetChildren():
                child.Bind(wx.EVT_RIGHT_DOWN, self.contextHandler(contentPanel))

            mainSizer.Add(tp, 0, wx.EXPAND | wx.LEFT, 3)
            if i < maxviews - 1:
                mainSizer.Add(wx.StaticLine(self, wx.ID_ANY, style=wx.HORIZONTAL), 0,
                              wx.EXPAND | wx.TOP | wx.LEFT | wx.RIGHT, 2)
            i += 1
            tp.OnStateChange(tp.GetBestSize())

        width, height = self.GetSize()
        self.SetMinSize((width + 9, -1))

        self.mainFrame = gui.mainFrame.MainFrame.getInstance()
        self.mainFrame.Bind(GE.FIT_CHANGED, self.fitChanged)
示例#9
0
 def switchToFirepowerView(self, event):
     # Getting the active fit
     mainFrame = gui.mainFrame.MainFrame.getInstance()
     sFit = Fit.getInstance()
     fit = sFit.getFit(mainFrame.getActiveFit())
     # Remove ourselves from statsPane's view list
     self.parent.views.remove(self)
     self._cachedValues = []
     # And no longer display us
     self.panel.GetSizer().Clear(True)
     self.panel.GetSizer().Layout()
     # Get the new view
     view = StatsView.getView("firepowerViewFull")(self.parent)
     view.populatePanel(self.panel, self.headerPanel)
     # Populate us in statsPane's view list
     self.parent.views.append(view)
     # Get the TogglePanel
     tp = self.panel.GetParent()
     tp.SetLabel(view.getHeaderText(fit))
     view.refreshPanel(fit)
示例#10
0
 def switchToFirepowerView(self, event):
     # Getting the active fit
     mainFrame = gui.mainFrame.MainFrame.getInstance()
     sFit = Fit.getInstance()
     fit = sFit.getFit(mainFrame.getActiveFit())
     # Remove ourselves from statsPane's view list
     self.parent.views.remove(self)
     self._cachedValues = []
     # And no longer display us
     self.panel.GetSizer().Clear(True)
     self.panel.GetSizer().Layout()
     # Get the new view
     view = StatsView.getView("firepowerViewFull")(self.parent)
     view.populatePanel(self.panel, self.headerPanel)
     # Populate us in statsPane's view list
     self.parent.views.append(view)
     # Get the TogglePanel
     tp = self.panel.GetParent()
     # Bind the new panel's children to allow context menu access
     tp.SetLabel(view.getHeaderText(fit))
     view.refreshPanel(fit)
示例#11
0
 def __init__(self, parent):
     StatsView.__init__(self)
     self.parent = parent
     self._cachedShip = 0
     self._cachedFittings = 0
     self._cachedTotal = 0
示例#12
0
 def __init__(self, parent):
     StatsView.__init__(self)
     self.parent = parent
     self._cachedValues = []
示例#13
0
 def __init__(self, parent):
     StatsView.__init__(self)
     self.parent = parent
     self.settings = MarketPriceSettings.getInstance()
示例#14
0
 def __init__(self, parent):
     StatsView.__init__(self)
     self.parent = parent
     self._cachedValues = []
示例#15
0
 def __init__(self, parent):
     StatsView.__init__(self)
     self.parent = parent
     self.settings = PriceMenuSettings.getInstance()
示例#16
0
 def __init__(self, parent):
     StatsView.__init__(self)
     self.parent = parent
     self.mainFrame = gui.mainFrame.MainFrame.getInstance()
     self.mainFrame.additionsPane.notebook.Bind(gui.chromeTabs.EVT_NOTEBOOK_PAGE_CHANGED, self.pageChanged)
示例#17
0
 def __init__(self, parent):
     StatsView.__init__(self)
     self.parent = parent
     self.mainFrame = gui.mainFrame.MainFrame.getInstance()
     self.mainFrame.Bind(rvf.EFFECTIVE_HP_TOGGLED, self.toggleEffective)
     self.effective = True
示例#18
0
 def __init__(self, parent):
     StatsView.__init__(self)
     self.parent = parent
示例#19
0
 def __init__(self, parent):
     StatsView.__init__(self)
     self.parent = parent
示例#20
0
 def __init__(self, parent):
     StatsView.__init__(self)
     self.parent = parent
     self.mainFrame = gui.mainFrame.MainFrame.getInstance()
     self.mainFrame.Bind(rvf.EFFECTIVE_HP_TOGGLED, self.toggleEffective)
     self.effective = True
示例#21
0
 def __init__(self, parent):
     StatsView.__init__(self)
     self.parent = parent
     self.mainFrame = gui.mainFrame.MainFrame.getInstance()
     self.mainFrame.additionsPane.notebook.Bind(EVT_NOTEBOOK_PAGE_CHANGED,
                                                self.pageChanged)
示例#22
0
 def __init__(self, parent):
     StatsView.__init__(self)
     self.parent = parent
     self._cachedShip = 0
     self._cachedFittings = 0
     self._cachedTotal = 0