Esempio n. 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)
Esempio n. 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)
Esempio n. 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
Esempio n. 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
Esempio n. 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)
Esempio n. 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)
Esempio n. 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)
Esempio n. 8
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)
Esempio n. 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)
Esempio n. 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)
Esempio n. 11
0
 def __init__(self, parent):
     StatsView.__init__(self)
     self.parent = parent
     self._cachedShip = 0
     self._cachedFittings = 0
     self._cachedTotal = 0
Esempio n. 12
0
 def __init__(self, parent):
     StatsView.__init__(self)
     self.parent = parent
     self._cachedValues = []
Esempio n. 13
0
 def __init__(self, parent):
     StatsView.__init__(self)
     self.parent = parent
     self.settings = MarketPriceSettings.getInstance()
Esempio n. 14
0
 def __init__(self, parent):
     StatsView.__init__(self)
     self.parent = parent
     self._cachedValues = []
Esempio n. 15
0
 def __init__(self, parent):
     StatsView.__init__(self)
     self.parent = parent
     self.settings = PriceMenuSettings.getInstance()
Esempio n. 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)
Esempio n. 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
Esempio n. 18
0
 def __init__(self, parent):
     StatsView.__init__(self)
     self.parent = parent
Esempio n. 19
0
 def __init__(self, parent):
     StatsView.__init__(self)
     self.parent = parent
Esempio n. 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
Esempio n. 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)
Esempio n. 22
0
 def __init__(self, parent):
     StatsView.__init__(self)
     self.parent = parent
     self._cachedShip = 0
     self._cachedFittings = 0
     self._cachedTotal = 0