Add a collapsible additions pane for stuff like drones, implants, boosters, etc.
This commit is contained in:
39
gui/additionsPane.py
Normal file
39
gui/additionsPane.py
Normal 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()
|
||||||
@@ -20,6 +20,7 @@
|
|||||||
import wx
|
import wx
|
||||||
from gui import bitmapLoader
|
from gui import bitmapLoader
|
||||||
from gui.mainMenuBar import MainMenuBar
|
from gui.mainMenuBar import MainMenuBar
|
||||||
|
from gui.additionsPane import AdditionsPane
|
||||||
from gui.mainToolBar import MainToolBar
|
from gui.mainToolBar import MainToolBar
|
||||||
from gui.marketBrowser import MarketBrowser
|
from gui.marketBrowser import MarketBrowser
|
||||||
from gui.multiSwitch import MultiSwitch
|
from gui.multiSwitch import MultiSwitch
|
||||||
@@ -61,12 +62,20 @@ class MainFrame(wx.Frame):
|
|||||||
self.statsSizer = wx.BoxSizer(wx.HORIZONTAL)
|
self.statsSizer = wx.BoxSizer(wx.HORIZONTAL)
|
||||||
statsFitviewPanel.SetSizer(self.statsSizer)
|
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()
|
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.statsPane = StatsPane(statsFitviewPanel)
|
||||||
|
|
||||||
self.statsSizer.Add(self.fitMultiSwitch, 1, wx.EXPAND)
|
|
||||||
self.statsSizer.Add(self.statsPane, 0, wx.EXPAND)
|
self.statsSizer.Add(self.statsPane, 0, wx.EXPAND)
|
||||||
|
|
||||||
self.splitter.SplitVertically(self.notebookBrowsers, statsFitviewPanel)
|
self.splitter.SplitVertically(self.notebookBrowsers, statsFitviewPanel)
|
||||||
|
|||||||
@@ -51,6 +51,7 @@ class MultiSwitch(wx.Notebook):
|
|||||||
p.type = "fit"
|
p.type = "fit"
|
||||||
sizer = wx.BoxSizer(wx.HORIZONTAL)
|
sizer = wx.BoxSizer(wx.HORIZONTAL)
|
||||||
p.view = FittingView(p)
|
p.view = FittingView(p)
|
||||||
|
|
||||||
sizer.Add(p.view, 1, wx.EXPAND | wx.RESERVE_SPACE_EVEN_IF_HIDDEN)
|
sizer.Add(p.view, 1, wx.EXPAND | wx.RESERVE_SPACE_EVEN_IF_HIDDEN)
|
||||||
|
|
||||||
p.SetSizer(sizer)
|
p.SetSizer(sizer)
|
||||||
|
|||||||
Reference in New Issue
Block a user