当前位置: 首页>>代码示例>>Python>>正文


Python StatsView.getView方法代码示例

本文整理汇总了Python中gui.statsView.StatsView.getView方法的典型用法代码示例。如果您正苦于以下问题:Python StatsView.getView方法的具体用法?Python StatsView.getView怎么用?Python StatsView.getView使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在gui.statsView.StatsView的用法示例。


在下文中一共展示了StatsView.getView方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: switchToMiningYieldView

# 需要导入模块: from gui.statsView import StatsView [as 别名]
# 或者: from gui.statsView.StatsView import getView [as 别名]
    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)
开发者ID:FoobarRaboof,项目名称:Pyfa,代码行数:28,代码来源:firepowerViewFull.py

示例2: __init__

# 需要导入模块: from gui.statsView import StatsView [as 别名]
# 或者: from gui.statsView.StatsView import getView [as 别名]
    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)
开发者ID:copyliu,项目名称:Pyfa,代码行数:57,代码来源:statsPane.py

示例3: switchToFirepowerView

# 需要导入模块: from gui.statsView import StatsView [as 别名]
# 或者: from gui.statsView.StatsView import getView [as 别名]
 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)
开发者ID:blitzmann,项目名称:Pyfa,代码行数:23,代码来源:miningyieldViewFull.py


注:本文中的gui.statsView.StatsView.getView方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。