]> git.saurik.com Git - wxWidgets.git/blobdiff - utils/wxPython/demo/Sizers.py
fixed somebody's poorly done StreamSize-->GetSize transition
[wxWidgets.git] / utils / wxPython / demo / Sizers.py
index 6ebdfcf8c4e861976ef7ec715345ce57fb167f6f..02befadba1a21234888ff70abaf06920762bddc4 100644 (file)
@@ -111,21 +111,17 @@ def makeSimpleBorder3(win):
 def makeBoxInBox(win):
     box = wxBoxSizer(wxVERTICAL)
 
-    btn = wxButton(win, 1010, "one")
-    box.Add(btn)
+    box.Add(wxButton(win, 1010, "one"))
 
     box2 = wxBoxSizer(wxHORIZONTAL)
-    btn = wxButton(win, 1010, "two")
-    box2.Add(btn)
-    btn = wxButton(win, 1010, "three")
-    box2.Add(btn)
-    btn = wxButton(win, 1010, "four")
-    box2.Add(btn)
-    btn = wxButton(win, 1010, "five")
-    box2.Add(btn)
+    box2.AddMany([ wxButton(win, 1010, "two"),
+                   wxButton(win, 1010, "three"),
+                   wxButton(win, 1010, "four"),
+                   wxButton(win, 1010, "five"),
+                   ])
 
     box3 = wxBoxSizer(wxVERTICAL)
-    box3.AddMany([ (wxButton(win, 1010, "six"),   1),
+    box3.AddMany([ (wxButton(win, 1010, "six"),   0),
                    (wxButton(win, 1010, "seven"), 2),
                    (wxButton(win, 1010, "eight"), 1),
                    (wxButton(win, 1010, "nine"),  1),
@@ -134,8 +130,7 @@ def makeBoxInBox(win):
     box2.Add(box3, 1)
     box.Add(box2, 1)
 
-    btn = wxButton(win, 1010, "ten")
-    box.Add(btn)
+    box.Add(wxButton(win, 1010, "ten"))
 
     return box
 
@@ -152,18 +147,27 @@ def makeBoxInBorder(win):
 
 def makeBorderInBox(win):
     insideBox = wxBoxSizer(wxHORIZONTAL)
-    insideBox.Add(makeSimpleBox3(win), 1)
+
+    box2 = wxBoxSizer(wxHORIZONTAL)
+    box2.AddMany([ wxButton(win, 1010, "one"),
+                   wxButton(win, 1010, "two"),
+                   wxButton(win, 1010, "three"),
+                   wxButton(win, 1010, "four"),
+                   wxButton(win, 1010, "five"),
+                 ])
+
+    insideBox.Add(box2, 0)
 
     bdr = wxBorderSizer(wxALL)
     bdr.Add(wxButton(win, 1010, "border"), 20)
     insideBox.Add(bdr, 1)
 
     box3 = wxBoxSizer(wxVERTICAL)
-    box3.AddMany([ (wxButton(win, 1010, "six"),   1),
+    box3.AddMany([ (wxButton(win, 1010, "six"),   0),
                    (wxButton(win, 1010, "seven"), 2),
                    (wxButton(win, 1010, "eight"), 1),
                    (wxButton(win, 1010, "nine"),  1),
-                   ])
+                 ])
     insideBox.Add(box3, 1)
 
     outsideBox = wxBoxSizer(wxVERTICAL)
@@ -238,7 +242,7 @@ theTests = [
      ),
 
     ("Border in a Box", makeBorderInBox,
-     ""
+     "Another nesting example.  This one has Boxes and a Border inside another Box."
      ),
 
     ]
@@ -251,11 +255,10 @@ class TestFrame(wxFrame):
 
         self.sizer = sizerFunc(self)
         self.CreateStatusBar()
-
+        self.SetStatusText("Resize this frame to see how the sizers respond...")
         self.sizer.FitWindow(self)
 
 
-
     def OnSize(self, event):
         size = self.GetClientSize()
         self.sizer.Layout(size)