]> git.saurik.com Git - wxWidgets.git/blobdiff - wxPython/wx/tools/XRCed/xxx.py
VC6 has problems with std::vector and identifiers names 'iterator' in GDI+ headers...
[wxWidgets.git] / wxPython / wx / tools / XRCed / xxx.py
index cdbc54c0307f7d8166e83a75beefb7706709fa61..de19e8910b5c89afc469ba706d8b9e6fd2c0f664 100644 (file)
@@ -315,6 +315,14 @@ class xxxObject:
         else: obj = self
         obj.name = name
         obj.node.setAttribute('name', name)
+    # Set normal (text) params
+    def set(self, param, value):
+        try:
+            self.params[param].update(value)
+        except KeyError:
+            p = xxxParam(g.tree.dom.createElement(param))
+            p.update(value)
+            self.params[param] = p
     # Special processing for growablecols-like parameters
     # represented by several nodes
     def special(self, tag, node):
@@ -837,7 +845,8 @@ class xxxChildContainer(xxxObject):
 class xxxSizerItem(xxxChildContainer):
     allParams = ['option', 'flag', 'border', 'minsize', 'ratio']
     paramDict = {'option': ParamInt, 'minsize': ParamPosSize, 'ratio': ParamPosSize}
-    #default = {'cellspan': '1,1'}
+    defaults_panel = {}
+    defaults_control = {}
     def __init__(self, parent, element, refElem=None):
         # For GridBag sizer items, extra parameters added
         if isinstance(parent, xxxGridBagSizer):
@@ -847,6 +856,13 @@ class xxxSizerItem(xxxChildContainer):
         if 'pos' in self.child.allParams:
             self.child.allParams = self.child.allParams[:]
             self.child.allParams.remove('pos')
+        # Set defaults for some children types
+        if isinstance(self.child, xxxContainer) and not self.child.isSizer:
+            for param,v in self.defaults_panel.items():
+                self.set(param, v)
+        elif isinstance(self.child, xxxObject):
+            for param,v in self.defaults_control.items():
+                self.set(param, v)
     def resetChild(self, xxx):
         xxxChildContainer.resetChild(self, xxx)
         # Remove pos parameter - not needed for sizeritems