From: Robin Dunn Date: Mon, 3 May 2004 20:34:05 +0000 (+0000) Subject: Updated layout test X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/3bcdbe527fde583072eefab67de8974c0e17a1e2 Updated layout test git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@27079 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/wxPython/misc/image.png b/wxPython/misc/image.png new file mode 100644 index 0000000000..5a4ce74b89 Binary files /dev/null and b/wxPython/misc/image.png differ diff --git a/wxPython/misc/widgetLayoutTest.cfg b/wxPython/misc/widgetLayoutTest.cfg index 9a1c4d8d07..c54c93d54c 100644 --- a/wxPython/misc/widgetLayoutTest.cfg +++ b/wxPython/misc/widgetLayoutTest.cfg @@ -10,7 +10,7 @@ ['wx', 'BitmapButton', '-1, wx.Bitmap("image.png")'], ['wx', 'StaticBitmap', '-1, wx.Bitmap("image.png")'], ['wx.calendar', 'CalendarCtrl', '-1'], -['wx', 'CheckListBox', '-1, choices="one two three four five six seven eight".split()'], +['wx', 'CheckListBox', '-1, size=(100,-1), choices="one two three four five six seven eight".split()'], ['wx', 'Choice', '-1, choices="one two three four five six seven eight".split()'], ['wx', 'ComboBox', '-1, choices="one two three four five six seven eight".split(), value="default"'], ['wx', 'Gauge', '-1, 100'], diff --git a/wxPython/misc/widgetLayoutTest.py b/wxPython/misc/widgetLayoutTest.py index e9f61c6bbb..02a8a33695 100644 --- a/wxPython/misc/widgetLayoutTest.py +++ b/wxPython/misc/widgetLayoutTest.py @@ -42,8 +42,7 @@ class LayoutTestFrame(wx.Frame): bottomPanel.SetDefaultBackgroundColour("light blue") self.testPanel = wx.Panel(bottomPanel, name="testPanel") - self.testPanel.SetSizeHints((20,20)) - #self.testPanel.SetDefaultBackgroundColour("dark red") + self.testPanel.SetDefaultBackgroundColour((205, 183, 181)) # mistyrose3 self.testWidget = None @@ -263,7 +262,7 @@ class LayoutTestFrame(wx.Frame): import traceback traceback.print_exc() return - + # Put the widget in a sizer and the sizer in the testPanel sizer = wx.BoxSizer(wx.VERTICAL) sizer.Add(w, 0, wx.ALL, 5) @@ -274,25 +273,35 @@ class LayoutTestFrame(wx.Frame): # make the destroy button be default now self.destroyBtn.SetDefault() + + if True: + print 'w size', w.GetSize() + print 'w minsize', w.GetMinSize() + print 'w bestsize', w.GetBestSize() + print 'w abstsize', w.GetAdjustedBestSize() + + tp = self.testPanel + #print tp.GetSizer() + print 'tp size', tp.GetSize() + print 'tp minsize', tp.GetMinSize() + print 'tp bestsize', tp.GetBestSize() + print 'tp abstsize', tp.GetAdjustedBestSize() + def OnDestroyWidget(self, evt): self.testWidget.Destroy() self.testWidget = None self.testPanel.SetSizer(None, True) - self.bottomSizer.Layout() + # ensure the panel shrinks again + self.testPanel.SetSizeHints((20,20)) + self.bottomSizer.Layout() + self.testPanel.SetSizeHints(wx.DefaultSize) + # make the create button be default now self.createBtn.SetDefault() -## tp = self.testPanel -## print tp.GetSizer() -## print 'size', tp.GetSize() -## print 'minsize', tp.GetMinSize() -## print 'bestsize', tp.GetBestSize() -## print 'abstsize', tp.GetAdjustedBestSize() - - def OnClear(self, evt): self.moduleName.SetValue("")