Add a collapsible additions pane for stuff like drones, implants, boosters, etc.

This commit is contained in:
cncfanatics
2010-09-02 13:18:56 +02:00
parent 28a37ee15e
commit 06e76a2cea
3 changed files with 54 additions and 5 deletions

39
gui/additionsPane.py Normal file
View File

@@ -0,0 +1,39 @@
#===============================================================================
# Copyright (C) 2010 Diego Duclos
#
# This file is part of pyfa.
#
# pyfa is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# pyfa is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with pyfa. If not, see <http://www.gnu.org/licenses/>.
#===============================================================================
import wx
import gui.mainFrame
class AdditionsPane(wx.CollapsiblePane):
def collapseChanged(self, event):
self.mainFrame.fittingPanel.Layout()
def __init__(self, parent):
wx.CollapsiblePane.__init__(self, parent)
self.SetLabel("Additions")
pane = self.GetPane()
size = wx.Size()
size.SetHeight(200)
pane.SetSize(size)
self.Bind(wx.EVT_COLLAPSIBLEPANE_CHANGED, self.collapseChanged)
self.mainFrame = gui.mainFrame.MainFrame.getInstance()
self.Expand()

View File

@@ -20,6 +20,7 @@
import wx
from gui import bitmapLoader
from gui.mainMenuBar import MainMenuBar
from gui.additionsPane import AdditionsPane
from gui.mainToolBar import MainToolBar
from gui.marketBrowser import MarketBrowser
from gui.multiSwitch import MultiSwitch
@@ -61,12 +62,20 @@ class MainFrame(wx.Frame):
self.statsSizer = wx.BoxSizer(wx.HORIZONTAL)
statsFitviewPanel.SetSizer(self.statsSizer)
self.fitMultiSwitch = MultiSwitch(statsFitviewPanel)
self.fittingPanel = wx.Panel(statsFitviewPanel)
fittingSizer = wx.BoxSizer(wx.VERTICAL)
self.fittingPanel.SetSizer(fittingSizer)
self.statsSizer.Add(self.fittingPanel, 1, wx.EXPAND)
self.fitMultiSwitch = MultiSwitch(self.fittingPanel)
self.fitMultiSwitch.AddTab()
fittingSizer.Add(self.fitMultiSwitch, 1, wx.EXPAND)
self.additionsPane = AdditionsPane(self.fittingPanel)
fittingSizer.Add(self.additionsPane, 0, wx.EXPAND)
self.statsPane = StatsPane(statsFitviewPanel)
self.statsSizer.Add(self.fitMultiSwitch, 1, wx.EXPAND)
self.statsSizer.Add(self.statsPane, 0, wx.EXPAND)
self.splitter.SplitVertically(self.notebookBrowsers, statsFitviewPanel)
@@ -106,7 +115,7 @@ class MainFrame(wx.Frame):
# Quit
self.Bind(wx.EVT_MENU, self.ExitApp, id=wx.ID_EXIT)
# Widgets Inspector
self.Bind(wx.EVT_MENU, self.openWXInspectTool, id=911)
self.Bind(wx.EVT_MENU, self.openWXInspectTool, id=911)
# About
self.Bind(wx.EVT_MENU, self.ShowAboutBox, id=wx.ID_ABOUT)
@@ -128,4 +137,4 @@ class MainFrame(wx.Frame):
if not wnd:
wnd = self
InspectionTool().Show(wnd, True)

View File

@@ -51,6 +51,7 @@ class MultiSwitch(wx.Notebook):
p.type = "fit"
sizer = wx.BoxSizer(wx.HORIZONTAL)
p.view = FittingView(p)
sizer.Add(p.view, 1, wx.EXPAND | wx.RESERVE_SPACE_EVEN_IF_HIDDEN)
p.SetSizer(sizer)