Replaced CollapsiblePane in AdditionsPane with TogglePanel, old code remains commented for now

This commit is contained in:
HomeWorld
2010-09-17 20:13:03 +03:00
parent ad6da2a331
commit 8f32e53795
2 changed files with 17 additions and 11 deletions

View File

@@ -23,21 +23,24 @@ from gui.boosterView import BoosterView
from gui.droneView import DroneView
from gui.implantView import ImplantView
from gui.projectedView import ProjectedView
from gui.pyfatogglepanel import TogglePanel
class AdditionsPane(wx.CollapsiblePane):
def collapseChanged(self, event):
self.mainFrame.fittingPanel.Layout()
self.GetPane().Layout()
class AdditionsPane(TogglePanel):
# def collapseChanged(self, event):
# self.mainFrame.fittingPanel.Layout()
# self.GetPane().Layout()
def __init__(self, parent):
wx.CollapsiblePane.__init__(self, parent)
TogglePanel.__init__(self, parent, forceLayout = 1)
self.SetLabel("Additions")
pane = self.GetPane()
pane = self.GetContentPane()
baseSizer = wx.BoxSizer(wx.HORIZONTAL)
pane.SetSizer(baseSizer)
self.Bind(wx.EVT_COLLAPSIBLEPANE_CHANGED, self.collapseChanged)
# self.Bind(wx.EVT_COLLAPSIBLEPANE_CHANGED, self.collapseChanged)
self.mainFrame = gui.mainFrame.MainFrame.getInstance()
@@ -52,5 +55,5 @@ class AdditionsPane(wx.CollapsiblePane):
self.notebook.AddPage(BoosterView(self.notebook), "Boosters")
self.notebook.AddPage(ProjectedView(self.notebook), "Projected")
self.Expand()
# self.Expand()

View File

@@ -31,12 +31,12 @@ from gui import bitmapLoader
class TogglePanel ( wx.Panel ):
def __init__( self, parent ):
def __init__( self, parent , forceLayout = -1):
wx.Panel.__init__ ( self, parent, id = wx.ID_ANY, pos = wx.DefaultPosition, size = wx.Size( -1,-1 ), style = wx.TAB_TRAVERSAL )
self._toggle = 1
self.parent = parent
self.forceLayout = forceLayout
self.bkColour = self.GetBackgroundColour()
# Odd stuff :S
@@ -251,7 +251,10 @@ class TogglePanel ( wx.Panel ):
self._toggle *=-1
self.Thaw()
self.OnStateChange(self.GetBestSize())
if self.forceLayout == -1:
self.OnStateChange(self.GetBestSize())
else:
self.parent.Layout()
# self.parent.Layout()