]> git.saurik.com Git - wxWidgets.git/blobdiff - utils/wxPython/lib/grids.py
1. wxDir works for MSW and documented
[wxWidgets.git] / utils / wxPython / lib / grids.py
index d67443e07b38d83876115911b6ebd0aebad6c7fd..2a8d58c80cd20ea3e6d88801ee221d646c853d9a 100644 (file)
@@ -1,5 +1,5 @@
 #----------------------------------------------------------------------
-# Name:        wxPython.lib.GridSizer
+# Name:        wxPython.lib.grids
 # Purpose:     An example sizer derived from the C++ wxPySizer that
 #              sizes items in a fixed or flexible grid.
 #
@@ -13,7 +13,7 @@
 
 """
 
-In this module you will find wxGridSizer and wxFlexgridSizer.
+In this module you will find wxGridSizer and wxFlexGridSizer.
 wxGridSizer arrainges its items in a grid in which all the widths and
 heights are the same.  wxFlexgridSizer allows different widths and
 heights, and you can also specify rows and/or columns that are
@@ -132,22 +132,18 @@ class wxGridSizer(wxPySizer):
         isz = item.CalcMin()
         flag = item.GetFlag()
 
-        if flag & wxEXPAND:
+        if flag & wxEXPAND or flag & wxSHAPED:
             isz = wxSize(w, h)
-
-        elif flag & wxCENTER:
-            ipt.x = x + (w - isz.width) / 2
-            ipt.y = y + (h - isz.height) / 2
-
-        if flag & wxALIGN_LEFT:
-            ipt.x = x
-        elif flag & wxALIGN_RIGHT:
-            ipt.x = x + (w - isz.width)
-
-        if flag & wxALIGN_TOP:
-            ipt.y = y
-        elif flag & wxALIGN_BOTTOM:
-            ipt.y = y + (h - isz.height)
+        else:
+            if flag & wxALIGN_CENTER_HORIZONTAL:
+                ipt.x = x + (w - isz.width) / 2
+            elif flag & wxALIGN_RIGHT:
+                ipt.x = x + (w - isz.width)
+
+            if flag & wxALIGN_CENTER_VERTICAL:
+                ipt.y = y + (h - isz.height) / 2
+            elif flag & wxALIGN_BOTTOM:
+                ipt.y = y + (h - isz.height)
 
         item.SetDimension(ipt, isz)