dabo Commit
Revision 6651
Date: 2011-07-03 07:09:39 -0700 (Sun, 03 Jul 2011)
Author: Ed
Trac: http://trac.dabodev.com/changeset/6651

Changed:
U   trunk/dabo/ui/uiwx/__init__.py
U   trunk/dabo/ui/uiwx/dSizer.py

Log:
Added the convenience classes dSizerH and dSizerV for making horizontal and 
vertical sizers, respectively. Yes, I am lazy.

Diff:
Modified: trunk/dabo/ui/uiwx/__init__.py
===================================================================
--- trunk/dabo/ui/uiwx/__init__.py      2011-07-03 14:02:13 UTC (rev 6650)
+++ trunk/dabo/ui/uiwx/__init__.py      2011-07-03 14:09:39 UTC (rev 6651)
@@ -165,6 +165,8 @@
 from dPdfWindow import dPdfWindow
 from dSearchBox import dSearchBox
 from dSizer import dSizer
+from dSizer import dSizerV
+from dSizer import dSizerH
 from dBorderSizer import dBorderSizer
 from dSlider import dSlider
 from dSpinner import dSpinner

Modified: trunk/dabo/ui/uiwx/dSizer.py
===================================================================
--- trunk/dabo/ui/uiwx/dSizer.py        2011-07-03 14:02:13 UTC (rev 6650)
+++ trunk/dabo/ui/uiwx/dSizer.py        2011-07-03 14:09:39 UTC (rev 6651)
@@ -11,13 +11,17 @@
                self._border = 0
                self._parent = None
 
-               if args:
-                       # The orientation was passed as a standalong argument
-                       kwargs["Orientation"] = args[0]
-                       args = tuple(args[1:])
+               properties = self._extractKey(kwargs, "properties", {})
+               fixedOrient = self._extractKey(kwargs, "FixedOrientation")
+               if fixedOrient:
+                       orient = fixedOrient
+               else:
+                       if args:
+                               # The orientation was passed as a standalone 
argument
+                               kwargs["Orientation"] = args[0]
+                               args = tuple(args[1:])
 
-               properties = self._extractKey(kwargs, "properties", {})
-               orient = self._extractKey((kwargs, properties), "Orientation", 
"h")
+                       orient = self._extractKey((kwargs, properties), 
"Orientation", "h")
                if orient[0].lower() == "v":
                        orientation = wx.VERTICAL
                else:
@@ -49,5 +53,18 @@
                return dabo.ui.dBorderSizer
 
 
+
+class dSizerV(dSizer):
+       def __init__(self, *args, **kwargs ):
+               kwargs["FixedOrientation"] = "V"
+               super(dSizerV, self).__init__(*args, **kwargs)
+
+
+
+class dSizerH(dSizer):
+       def __init__(self, *args, **kwargs ):
+               kwargs["FixedOrientation"] = "H"
+               super(dSizerH, self).__init__(*args, **kwargs)
+       
 if __name__ == "__main__":
        s = dSizer()



_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-dev
Searchable Archives: http://leafe.com/archives/search/dabo-dev
This message: 
http://leafe.com/archives/byMID/[email protected]

Reply via email to