MCPcopy Index your code
hub / github.com/pyfa-org/Pyfa / MainFrame

Class MainFrame

gui/mainFrame.py:134–998  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

132
133
134class MainFrame(wx.Frame):
135 __instance = None
136
137 @classmethod
138 def getInstance(cls):
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

Callers 2

pyfa.pyFile · 0.90
getInstanceMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected