dabo Commit
Revision 4631
Date: 2008-11-02 10:20:49 -0800 (Sun, 02 Nov 2008)
Author: Ed
Trac: http://svn.dabodev.com/trac/dabo/changeset/4631

Changed:
U   trunk/ide/ClassDesignerComponents.py

Log:
This complements [4571], which creates different sizer defaults depending on 
the orientation of the controlling sizer.


Diff:
Modified: trunk/ide/ClassDesignerComponents.py
===================================================================
--- trunk/ide/ClassDesignerComponents.py        2008-11-02 13:31:59 UTC (rev 
4630)
+++ trunk/ide/ClassDesignerComponents.py        2008-11-02 18:20:49 UTC (rev 
4631)
@@ -266,8 +266,15 @@
                        defaults = szOrDict
                else:
                        # First, what type of sizer is it?
-                       is2D = isinstance(szOrDict, dabo.ui.dGridSizer)
-                       defaults = {True: szItemDefaults[2], False: 
szItemDefaults[1]}[is2D].copy()
+                       try:
+                               cls = self.superControl
+                       except AttributeError:
+                               cls = self.__class__
+                       if isinstance(szOrDict, dabo.ui.dGridSizer):
+                               typ = "G"
+                       else:
+                               typ = szOrDict.Orientation.upper()[0]
+                       defaults = self.Controller.getDefaultSizerProps(cls, 
typ).copy()
                if isinstance(self, LayoutPanel):
                        defaults["Expand"] = True
                        defaults["Proportion"] = 1




_______________________________________________
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