Invalidate the cached best size whenever something changes that could affect the best size

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxPython/Phoenix/trunk@73342 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robin Dunn
2013-01-03 19:10:02 +00:00
parent 53d0c8de00
commit f7bf3c1a1e

View File

@@ -481,8 +481,6 @@ class PyCollapsiblePane(wx.Panel):
:param `sz`: an instance of :class:`Size`.
"""
# minimal size has priority over the best size so set here our min size
self.SetMinSize(sz)
self.SetSize(sz)
if self.HasAGWFlag(wx.CP_NO_TLW_RESIZE):
@@ -534,7 +532,7 @@ class PyCollapsiblePane(wx.Panel):
# collapsed . expanded transition
# force our parent to "fit", i.e. expand so that it can honour
# our minimal size
# our best size
top.Fit()
@@ -554,6 +552,8 @@ class PyCollapsiblePane(wx.Panel):
# update our state
self._pPane.Show(not collapse)
self._bCollapsed = collapse
self.InvalidateBestSize()
self.Thaw()
# update button label
@@ -603,7 +603,8 @@ class PyCollapsiblePane(wx.Panel):
self._pButton.SetLabel(self.GetBtnLabel())
self._pButton.SetInitialSize()
self._pButton.Refresh()
self.InvalidateBestSize()
self.Layout()
@@ -625,6 +626,7 @@ class PyCollapsiblePane(wx.Panel):
"""
self._pButton.SetFont(font)
self.InvalidateBestSize()
self.Layout()
@@ -656,6 +658,7 @@ class PyCollapsiblePane(wx.Panel):
"""
self._expanderDimensions = width, height
self.InvalidateBestSize()
if self._sz:
self._sz.Layout()
if self._pButton:
@@ -778,6 +781,7 @@ class PyCollapsiblePane(wx.Panel):
if self._pPane:
self._pButton.MoveBeforeInTabOrder(self._pPane)
self.InvalidateBestSize()
self.Layout()