def __init__(self, parent, mainFrame): TogglePanel.__init__(self, parent, force_layout=1) self.mainFrame = mainFrame self.SetLabel(_t("Additions")) pane = self.GetContentPanel() baseSizer = wx.BoxSizer(wx.HORIZONTAL) pane.SetSizer(baseSizer) self.notebook = ChromeNotebook(pane, can_add=False, tabWidthMode=1) self.notebook.SetMinSize((-1, 1000)) baseSizer.Add(self.notebook, 1, wx.EXPAND) droneImg = BitmapLoader.getImage("drone_small", "gui") fighterImg = BitmapLoader.getImage("fighter_small", "gui") implantImg = BitmapLoader.getImage("implant_small", "gui") boosterImg = BitmapLoader.getImage("booster_small", "gui") projectedImg = BitmapLoader.getImage("projected_small", "gui") gangImg = BitmapLoader.getImage("fleet_fc_small", "gui") cargoImg = BitmapLoader.getImage("cargo_small", "gui") notesImg = BitmapLoader.getImage("skill_small", "gui") self.drone = DroneView(self.notebook) self.notebook.AddPage(self.drone, _t("Drones"), image=droneImg, closeable=False) self.fighter = FighterView(self.notebook) self.notebook.AddPage(self.fighter, _t("Fighters"), image=fighterImg, closeable=False) self.cargo = CargoView(self.notebook) self.notebook.AddPage(self.cargo, _t("Cargo"), image=cargoImg, closeable=False) self.implant = ImplantView(self.notebook) self.notebook.AddPage(self.implant, _t("Implants"), image=implantImg, closeable=False) self.booster = BoosterView(self.notebook) self.notebook.AddPage(self.booster, _t("Boosters"), image=boosterImg, closeable=False) self.projectedPage = ProjectedView(self.notebook) self.notebook.AddPage(self.projectedPage, _t("Projected"), image=projectedImg, closeable=False) self.gangPage = CommandView(self.notebook) self.notebook.AddPage(self.gangPage, _t("Command"), image=gangImg, closeable=False) self.notes = NotesView(self.notebook) self.notebook.AddPage(self.notes, _t("Notes"), image=notesImg, closeable=False) self.mainFrame.Bind(GE.FIT_CHANGED, self.OnFitChanged) self.mainFrame.Bind(GE.FIT_NOTES_CHANGED, self.OnNotesChanged) self.notebook.SetSelection(0)
def __init__(self, parent): TogglePanel.__init__(self, parent, force_layout=1) self.SetLabel("Additions") pane = self.GetContentPanel() baseSizer = wx.BoxSizer(wx.HORIZONTAL) pane.SetSizer(baseSizer) self.notebook = ChromeNotebook(pane, False) self.notebook.SetMinSize((-1, 1000)) baseSizer.Add(self.notebook, 1, wx.EXPAND) droneImg = BitmapLoader.getImage("drone_small", "gui") fighterImg = BitmapLoader.getImage("fighter_small", "gui") implantImg = BitmapLoader.getImage("implant_small", "gui") boosterImg = BitmapLoader.getImage("booster_small", "gui") projectedImg = BitmapLoader.getImage("projected_small", "gui") gangImg = BitmapLoader.getImage("fleet_fc_small", "gui") cargoImg = BitmapLoader.getImage("cargo_small", "gui") notesImg = BitmapLoader.getImage("skill_small", "gui") self.drone = DroneView(self.notebook) self.notebook.AddPage(self.drone, "Drones", image=droneImg, closeable=False) self.fighter = FighterView(self.notebook) self.notebook.AddPage(self.fighter, "Fighters", image=fighterImg, closeable=False) self.cargo = CargoView(self.notebook) self.notebook.AddPage(self.cargo, "Cargo", image=cargoImg, closeable=False) self.implant = ImplantView(self.notebook) self.notebook.AddPage(self.implant, "Implants", image=implantImg, closeable=False) self.booster = BoosterView(self.notebook) self.notebook.AddPage(self.booster, "Boosters", image=boosterImg, closeable=False) self.projectedPage = ProjectedView(self.notebook) self.notebook.AddPage(self.projectedPage, "Projected", image=projectedImg, closeable=False) self.gangPage = CommandView(self.notebook) self.notebook.AddPage(self.gangPage, "Command", image=gangImg, closeable=False) self.notes = NotesView(self.notebook) self.notebook.AddPage(self.notes, "Notes", image=notesImg, closeable=False) self.notebook.SetSelection(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.GetContentPanel() 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_CONTEXT_MENU, self.contextHandler(contentPanel, tp)) 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)
def ToggleContent(self, event): TogglePanel.ToggleContent(self, event) h = self.header_panel.GetSize()[1] + 4 if self.IsCollapsed(): self.old_pos = self.parent.GetSashPosition() self.parent.SetMinimumPaneSize(h) self.parent.SetSashPosition(h * -1, True) self.parent.SetSashInvisible(True) else: self.parent.SetSashInvisible(False) self.parent.SetMinimumPaneSize(200) self.parent.SetSashPosition(self.old_pos, True)
def __init__(self, parent): TogglePanel.__init__(self, parent, force_layout=1) self.SetLabel("Additions") pane = self.GetContentPanel() baseSizer = wx.BoxSizer(wx.HORIZONTAL) pane.SetSizer(baseSizer) self.notebook = ChromeNotebook(pane, False) self.notebook.SetMinSize((-1, 1000)) baseSizer.Add(self.notebook, 1, wx.EXPAND) droneImg = BitmapLoader.getImage("drone_small", "gui") fighterImg = BitmapLoader.getImage("fighter_small", "gui") implantImg = BitmapLoader.getImage("implant_small", "gui") boosterImg = BitmapLoader.getImage("booster_small", "gui") projectedImg = BitmapLoader.getImage("projected_small", "gui") gangImg = BitmapLoader.getImage("fleet_fc_small", "gui") cargoImg = BitmapLoader.getImage("cargo_small", "gui") notesImg = BitmapLoader.getImage("skill_small", "gui") self.drone = DroneView(self.notebook) self.notebook.AddPage(self.drone, "Drones", image=droneImg, closeable=False) self.fighter = FighterView(self.notebook) self.notebook.AddPage(self.fighter, "Fighters", image=fighterImg, closeable=False) self.cargo = CargoView(self.notebook) self.notebook.AddPage(self.cargo, "Cargo", image=cargoImg, closeable=False) self.implant = ImplantView(self.notebook) self.notebook.AddPage(self.implant, "Implants", image=implantImg, closeable=False) self.booster = BoosterView(self.notebook) self.notebook.AddPage(self.booster, "Boosters", image=boosterImg, closeable=False) self.projectedPage = ProjectedView(self.notebook) self.notebook.AddPage(self.projectedPage, "Projected", image=projectedImg, closeable=False) self.gangPage = CommandView(self.notebook) self.notebook.AddPage(self.gangPage, "Command", image=gangImg, closeable=False) self.notes = NotesView(self.notebook) self.notebook.AddPage(self.notes, "Notes", image=notesImg, closeable=False) self.notebook.SetSelection(0)