dabo Commit
Revision 4086
Date: 2008-05-20 22:47:20 -0700 (Tue, 20 May 2008)
Author: Ed
Trac: http://svn.dabodev.com/trac/dabo/changeset/4086

Changed:
U   trunk/ide/ClassDesignerComponents.py

Log:
Fixed a bug that only appeared when saving custom classes, in which some sizer 
settings would be ignored.


Diff:
Modified: trunk/ide/ClassDesignerComponents.py
===================================================================
--- trunk/ide/ClassDesignerComponents.py        2008-05-17 02:39:29 UTC (rev 
4085)
+++ trunk/ide/ClassDesignerComponents.py        2008-05-21 05:47:20 UTC (rev 
4086)
@@ -106,8 +106,7 @@
                else:
                        ra["designerClass"] = self.getClassName()
 
-#              hasSizer = not isClass and (hasattr(self, 
"ControllingSizerItem") and self.ControllingSizerItem)
-               hasSizer = (hasattr(self, "ControllingSizerItem") and 
self.ControllingSizerItem)
+               hasSizer = bool(hasattr(self, "ControllingSizerItem") and 
self.ControllingSizerItem)
                # We want to include some props whether they are the
                # default or not.
                if insideClass:
@@ -207,14 +206,9 @@
                try:
                        itmProps = 
self.ControllingSizer.getItemProps(self.ControllingSizerItem)
                        if insideClass:
-                               itmDiffProps = 
self._diffSizerItemProps(itmProps, classDict)
+                               itmDiffProps = 
self._diffSizerItemProps(itmProps, classDict, direct=True)
                        else:
                                itmDiffProps = 
self._diffSizerItemProps(itmProps, self.ControllingSizer)
-#                              try:
-#                                      defProps = 
self.Controller.getDefaultSizerProps(self.superControl)
-#                                      itmDiffProps = 
self._diffSizerItemProps(itmProps, defProps, direct=True)
-#                              except:
-#                                      itmDiffProps = 
self._diffSizerItemProps(itmProps, self.ControllingSizer)
                        ret["attributes"]["sizerInfo"] = itmDiffProps
                except AttributeError:
                        # Not controlled by a sizer.
@@ -235,9 +229,12 @@
 
        def _diffSizerItemProps(self, dct, szOrDict, direct=False):
                """Remove all of the default values from the sizer item 
props."""
-               # First, what type of sizer is it?
-               is2D = isinstance(szOrDict, dabo.ui.dGridSizer)
-               defaults = {True: szItemDefaults[2], False: 
szItemDefaults[1]}[is2D].copy()
+               if direct:
+                       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()
                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