| 35 | |
| 36 | |
| 37 | class StatsPane(wx.Panel): |
| 38 | AVAILIBLE_VIEWS = [ |
| 39 | "resources", |
| 40 | "resistances", |
| 41 | "recharge", |
| 42 | "firepower", |
| 43 | "outgoing", |
| 44 | "capacitor", |
| 45 | "targetingMisc", |
| 46 | "bombing", |
| 47 | "price", |
| 48 | ] |
| 49 | |
| 50 | # Don't have these....yet.... |
| 51 | ''' |
| 52 | "miningyield", "drones" |
| 53 | ] |
| 54 | ''' |
| 55 | |
| 56 | DEFAULT_VIEWS = [] |
| 57 | |
| 58 | settings = StatViewSettings.getInstance() |
| 59 | |
| 60 | for aView in AVAILIBLE_VIEWS: |
| 61 | if settings.get(aView) == 2: |
| 62 | DEFAULT_VIEWS.extend(["%sViewFull" % aView]) |
| 63 | pyfalog.debug("Setting full view for: {0}", aView) |
| 64 | elif settings.get(aView) == 1: |
| 65 | DEFAULT_VIEWS.extend(["%sViewMinimal" % aView]) |
| 66 | pyfalog.debug("Setting minimal view for: {0}", aView) |
| 67 | elif settings.get(aView) == 0: |
| 68 | pyfalog.debug("Setting disabled view for: {0}", aView) |
| 69 | else: |
| 70 | pyfalog.error("Unknown setting for view: {0}", aView) |
| 71 | |
| 72 | def fitChanged(self, event): |
| 73 | event.Skip() |
| 74 | activeFitID = self.mainFrame.getActiveFit() |
| 75 | if activeFitID is not None and activeFitID not in event.fitIDs: |
| 76 | return |
| 77 | sFit = Fit.getInstance() |
| 78 | fit = sFit.getFit(activeFitID) |
| 79 | for view in self.views: |
| 80 | view.refreshPanel(fit) |
| 81 | |
| 82 | def __init__(self, parent): |
| 83 | wx.Panel.__init__(self, parent) |
| 84 | |
| 85 | # Use 25% smaller fonts if MAC or force font size to 8 for msw/linux |
| 86 | |
| 87 | if "__WXMAC__" in wx.PlatformInfo: |
| 88 | self.SetWindowVariant(wx.WINDOW_VARIANT_SMALL) |
| 89 | else: |
| 90 | standardFont = wx.SystemSettings.GetFont(wx.SYS_DEFAULT_GUI_FONT) |
| 91 | standardFont.SetPointSize(8) |
| 92 | self.SetFont(standardFont) |
| 93 | |
| 94 | mainSizer = wx.BoxSizer(wx.VERTICAL) |
no test coverage detected