(self, title="pyfa")
| 139 | return cls.__instance if cls.__instance is not None else MainFrame() |
| 140 | |
| 141 | def __init__(self, title="pyfa"): |
| 142 | pyfalog.debug("Initialize MainFrame") |
| 143 | self.title = title |
| 144 | super().__init__(None, wx.ID_ANY, self.title) |
| 145 | |
| 146 | self.supress_left_up = False |
| 147 | |
| 148 | MainFrame.__instance = self |
| 149 | |
| 150 | # Load stored settings (width/height/maximized..) |
| 151 | self.LoadMainFrameAttribs() |
| 152 | |
| 153 | self.disableOverrideEditor = disableOverrideEditor |
| 154 | |
| 155 | # Fix for msw (have the frame background color match panel color |
| 156 | if 'wxMSW' in wx.PlatformInfo: |
| 157 | self.SetBackgroundColour(wx.SystemSettings.GetColour(wx.SYS_COLOUR_BTNFACE)) |
| 158 | |
| 159 | # Load and set the icon for pyfa main window |
| 160 | i = wx.Icon(BitmapLoader.getBitmap("pyfa", "gui")) |
| 161 | self.SetIcon(i) |
| 162 | |
| 163 | # Create the layout and windows |
| 164 | mainSizer = wx.BoxSizer(wx.HORIZONTAL) |
| 165 | |
| 166 | self.browser_fitting_split = wx.SplitterWindow(self, style=wx.SP_LIVE_UPDATE) |
| 167 | self.fitting_additions_split = wx.SplitterWindow(self.browser_fitting_split, style=wx.SP_LIVE_UPDATE) |
| 168 | |
| 169 | mainSizer.Add(self.browser_fitting_split, 1, wx.EXPAND | wx.LEFT, 2) |
| 170 | |
| 171 | self.fitMultiSwitch = MultiSwitch(self.fitting_additions_split) |
| 172 | self.additionsPane = AdditionsPane(self.fitting_additions_split, self) |
| 173 | |
| 174 | self.notebookBrowsers = ChromeNotebook(self.browser_fitting_split, False) |
| 175 | |
| 176 | marketImg = BitmapLoader.getImage("market_small", "gui") |
| 177 | shipBrowserImg = BitmapLoader.getImage("ship_small", "gui") |
| 178 | |
| 179 | self.marketBrowser = MarketBrowser(self.notebookBrowsers) |
| 180 | self.notebookBrowsers.AddPage(self.marketBrowser, _t("Market"), image=marketImg, closeable=False) |
| 181 | self.marketBrowser.splitter.SetSashPosition(self.marketHeight) |
| 182 | |
| 183 | self.shipBrowser = ShipBrowser(self.notebookBrowsers) |
| 184 | self.notebookBrowsers.AddPage(self.shipBrowser, _t("Fittings"), image=shipBrowserImg, closeable=False) |
| 185 | |
| 186 | self.notebookBrowsers.SetSelection(1) |
| 187 | |
| 188 | self.browser_fitting_split.SplitVertically(self.notebookBrowsers, self.fitting_additions_split) |
| 189 | self.browser_fitting_split.SetMinimumPaneSize(204) |
| 190 | self.browser_fitting_split.SetSashPosition(self.browserWidth) |
| 191 | |
| 192 | self.fitting_additions_split.SplitHorizontally(self.fitMultiSwitch, self.additionsPane, -200) |
| 193 | self.fitting_additions_split.SetMinimumPaneSize(200) |
| 194 | self.fitting_additions_split.SetSashPosition(self.fittingHeight) |
| 195 | self.fitting_additions_split.SetSashGravity(1.0) |
| 196 | |
| 197 | cstatsSizer = wx.BoxSizer(wx.VERTICAL) |
| 198 |
nothing calls this directly
no test coverage detected