dabo Commit
Revision 2528
Date: 2006-12-11 14:56:18 -0800 (Mon, 11 Dec 2006)
Author: Ed

Changed:
U   trunk/dabo/lib/DesignerXmlConverter.py

Log:
Modified the generated class code to not null out the Sizer property for 
contained controls. This was really messing up controls such as dRadioList that 
depended on their own internally-created sizer. We may have to add the sizer 
clearing on some complex container classes, but so far this seems to be working 
correctly.

Diff:
Modified: trunk/dabo/lib/DesignerXmlConverter.py
===================================================================
--- trunk/dabo/lib/DesignerXmlConverter.py      2006-12-11 18:19:18 UTC (rev 
2527)
+++ trunk/dabo/lib/DesignerXmlConverter.py      2006-12-11 22:56:18 UTC (rev 
2528)
@@ -143,7 +143,7 @@
                        if propDef["defaultType"] == "string":
                                val = "\"" + val + "\""
                        propInit += "self._%s%s = %s" % (prop[0].lower(), 
prop[1:], val) + LINESEP
-               self.classText +=       self.classTemplate  % (clsName, nm, 
+               self.classText +=       self.containerClassTemplate  % 
(clsName, nm, 
                                self.currParent, cleanAtts, nm, 
self.indentCode(propInit, 2))
                self.classText += self._stackInitText
                # Add the child code.
@@ -411,7 +411,6 @@
                        if propDef["defaultType"] == "string":
                                val = "\"" + val + "\""
                        propInit += "self._%s%s = %s" % (prop[0].lower(), 
prop[1:], val) + LINESEP
-               
                self.innerClassText += self.classTemplate  % (clsName, nm, 
                                self.currParent, cleanAtts, nm, 
self.indentCode(propInit, 2))
 
@@ -509,13 +508,19 @@
        
        def _defineTextBlocks(self):
                # Standard class template
-               self.classTemplate = """class %s(dabo.ui.%s):
+               self.containerClassTemplate = """class %s(dabo.ui.%s):
        def __init__(self, parent=%s, attProperties=%s):
                dabo.ui.%s.__init__(self, parent=parent, 
attProperties=attProperties)
                self.Sizer = None
 %s             
 
 """
+               self.classTemplate = """class %s(dabo.ui.%s):
+       def __init__(self, parent=%s, attProperties=%s):
+               dabo.ui.%s.__init__(self, parent=parent, 
attProperties=attProperties)
+%s             
+
+"""
                self._hdrText = """import dabo
 dabo.ui.loadUI("wx")
 




_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-dev

Reply via email to