X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/2481bf3cb684141768951d987a5adce365735051..9176f38f730c3415ac7a911c2f85cdea7eca4478:/wxPython/wx/tools/XRCed/xxx.py diff --git a/wxPython/wx/tools/XRCed/xxx.py b/wxPython/wx/tools/XRCed/xxx.py index e564f70873..cd37333885 100644 --- a/wxPython/wx/tools/XRCed/xxx.py +++ b/wxPython/wx/tools/XRCed/xxx.py @@ -223,7 +223,7 @@ class xxxObject: elif tag in self.specials: self.special(tag, node) elif tag == 'content': - if self.className == 'wxCheckList': + if self.className == 'wxCheckListBox': self.params[tag] = xxxParamContentCheckList(node) else: self.params[tag] = xxxParamContent(node) @@ -245,7 +245,7 @@ class xxxObject: if self.default.has_key(param): elem = g.tree.dom.createElement(param) if param == 'content': - if self.className == 'wxCheckList': + if self.className == 'wxCheckListBox': self.params[param] = xxxParamContentCheckList(elem) else: self.params[param] = xxxParamContent(elem) @@ -643,6 +643,28 @@ class xxxFlexGridSizer(xxxGridSizer): self.element.appendChild(node) self.special(param, node) +class xxxGridBagSizer(xxxSizer): + specials = ['growablecols', 'growablerows'] + allParams = ['vgap', 'hgap'] + specials + paramDict = {'growablecols':ParamIntList, 'growablerows':ParamIntList} + # Special processing for growable* parameters + # (they are represented by several nodes) + def special(self, tag, node): + if not self.params.has_key(tag): + # Create new multi-group + self.params[tag] = xxxParamMulti(node) + self.params[tag].append(xxxParamInt(node)) + def setSpecial(self, param, value): + # Straightforward implementation: remove, add again + self.params[param].remove() + del self.params[param] + for i in value: + node = g.tree.dom.createElement(param) + text = g.tree.dom.createTextNode(str(i)) + node.appendChild(text) + self.element.appendChild(node) + self.special(param, node) + # Container with only one child. # Not shown in tree. class xxxChildContainer(xxxObject): @@ -668,9 +690,13 @@ class xxxChildContainer(xxxObject): assert 0, 'no child found' class xxxSizerItem(xxxChildContainer): - allParams = ['option', 'flag', 'border', 'minsize'] - paramDict = {'option': ParamInt, 'minsize': ParamPosSize} + allParams = ['option', 'flag', 'border', 'minsize', 'ratio'] + paramDict = {'option': ParamInt, 'minsize': ParamPosSize, 'ratio': ParamPosSize} + #default = {'cellspan': '1,1'} def __init__(self, parent, element): + # For GridBag sizer items, extra parameters added + if isinstance(parent, xxxGridBagSizer): + self.allParams = self.allParams + ['cellpos', 'cellspan'] xxxChildContainer.__init__(self, parent, element) # Remove pos parameter - not needed for sizeritems if 'pos' in self.child.allParams: @@ -757,7 +783,7 @@ xxxDict = { 'wxScrollBar': xxxScrollBar, 'wxTreeCtrl': xxxTreeCtrl, 'wxListCtrl': xxxListCtrl, - 'wxCheckList': xxxCheckList, + 'wxCheckListBox': xxxCheckList, 'wxNotebook': xxxNotebook, 'notebookpage': xxxNotebookPage, 'wxHtmlWindow': xxxHtmlWindow, @@ -770,6 +796,7 @@ xxxDict = { 'wxStaticBoxSizer': xxxStaticBoxSizer, 'wxGridSizer': xxxGridSizer, 'wxFlexGridSizer': xxxFlexGridSizer, + 'wxGridBagSizer': xxxGridBagSizer, 'sizeritem': xxxSizerItem, 'spacer': xxxSpacer, @@ -784,7 +811,8 @@ xxxDict = { # Create IDs for all parameters of all classes paramIDs = {'fg': wxNewId(), 'bg': wxNewId(), 'exstyle': wxNewId(), 'font': wxNewId(), 'enabled': wxNewId(), 'focused': wxNewId(), 'hidden': wxNewId(), - 'tooltip': wxNewId(), 'encoding': wxNewId() + 'tooltip': wxNewId(), 'encoding': wxNewId(), + 'cellpos': wxNewId(), 'cellspan': wxNewId() } for cl in xxxDict.values(): if cl.allParams: