]> git.saurik.com Git - wxWidgets.git/blobdiff - utils/wxPython/demo/OldSizers.py
updated generated sources
[wxWidgets.git] / utils / wxPython / demo / OldSizers.py
index 8fd2ffc7f5e85e4e363c8acb569560028f889f2f..308bcec7c4f0971d632979fc1632e9b813d46e3c 100644 (file)
@@ -106,6 +106,34 @@ def makeSimpleBorder3(win):
     return bdr
 
 #----------------------------------------------------------------------
+
+def makeShapes(win):
+    box =wxBoxSizer(wxVERTICAL)
+    box.Add(wxStaticLine(win, -1), 0)
+    for line in (
+                 (wxANCHOR_NW, "NorthWest"),
+                 (wxANCHOR_NORTH, "North"),
+                 (wxANCHOR_NE, "NorthEast")
+                ), (
+                 (wxANCHOR_WEST, "West"),
+                 (wxANCHOR_NONE, "Center"),
+                 (wxANCHOR_EAST, "East")
+                ), (
+                 (wxANCHOR_SW, "SouthWest"),
+                 (wxANCHOR_SOUTH, "South"),
+                 (wxANCHOR_SE, "SouthEast")
+                ):
+        linebox =wxBoxSizer(wxHORIZONTAL)
+        linebox.Add(wxStaticLine(win, -1, style=wxVERTICAL), 0)
+        for (anchor, label) in line:
+            sizer =wxShapeSizer(anchor)
+            sizer.Add(wxButton(win, -1, label, size=wxSize(100, 50)))
+            linebox.Add(sizer, 1)
+            linebox.Add(wxStaticLine(win, -1, style=wxVERTICAL), 0)
+        box.Add(linebox, 1)
+        box.Add(wxStaticLine(win, -1), 0)
+    return box
+
 #----------------------------------------------------------------------
 
 def makeBoxInBox(win):
@@ -230,6 +258,13 @@ theTests = [
 
     ("", None, ""),
 
+
+    ("Proportional resize", makeShapes,
+     "The wxShapeSizer preserves the original proportions of the window."
+     ),
+
+    ("", None, ""),
+
     ("Boxes inside of boxes", makeBoxInBox,
      "This one shows nesting of boxes within boxes within boxes, using both "
      "orientations.  Notice also that button seven has a greater weighting "
@@ -275,7 +310,7 @@ class TestFrame(wxFrame):
 
 
 class TestSelectionPanel(wxPanel):
-    def __init__(self, parent, frame):
+    def __init__(self, parent, frame=NULL):
         wxPanel.__init__(self, parent, -1)
         self.frame = frame