self.undo = None
# Get attributes
self.className = element.getAttribute('class')
+ self.subclass = element.getAttribute('subclass')
if self.hasName: self.name = element.getAttribute('name')
# Set parameters (text element children)
self.params = {}
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)
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)
# Class name plus wx name
def treeName(self):
if self.hasChild: return self.child.treeName()
- if self.hasName and self.name: return self.className + ' "' + self.name + '"'
- return self.className
+ if self.subclass: className = self.subclass
+ else: className = self.className
+ if self.hasName and self.name: return className + ' "' + self.name + '"'
+ return className
+ # Class name or subclass
+ def panelName(self):
+ if self.subclass: return self.subclass + '(' + self.className + ')'
+ else: return self.className
################################################################################
required = ['title']
default = {'title': ''}
winStyles = ['wxDEFAULT_DIALOG_STYLE', 'wxSTAY_ON_TOP',
- 'wxDIALOG_MODAL', 'wxDIALOG_MODELESS',
+## 'wxDIALOG_MODAL', 'wxDIALOG_MODELESS',
'wxCAPTION', 'wxSYSTEM_MENU', 'wxRESIZE_BORDER', 'wxRESIZE_BOX',
'wxTHICK_FRAME',
'wxNO_3D', 'wxTAB_TRAVERSAL', 'wxCLIP_CHILDREN']
paramDict = {'usenotebooksizer': ParamBool}
winStyles = ['wxNB_FIXEDWIDTH', 'wxNB_LEFT', 'wxNB_RIGHT', 'wxNB_BOTTOM']
+class xxxSplitterWindow(xxxContainer):
+ allParams = ['orientation', 'sashpos', 'minsize', 'pos', 'size', 'style']
+ paramDict = {'orientation': ParamOrientation, 'sashpos': ParamUnit, 'minsize': ParamUnit }
+ winStyles = ['wxSP_3D', 'wxSP_3DSASH', 'wxSP_3DBORDER', 'wxSP_BORDER',
+ 'wxSP_NOBORDER', 'wxSP_PERMIT_UNSPLIT', 'wxSP_LIVE_UPDATE',
+ 'wxSP_NO_XP_THEME' ]
+
class xxxGenericDirCtrl(xxxObject):
allParams = ['defaultfolder', 'filter', 'defaultfilter', 'pos', 'size', 'style']
paramDict = {'defaultfilter': ParamInt}
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):
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:
'wxScrollBar': xxxScrollBar,
'wxTreeCtrl': xxxTreeCtrl,
'wxListCtrl': xxxListCtrl,
- 'wxCheckList': xxxCheckList,
+ 'wxCheckListBox': xxxCheckList,
'wxNotebook': xxxNotebook,
+ 'wxSplitterWindow': xxxSplitterWindow,
'notebookpage': xxxNotebookPage,
'wxHtmlWindow': xxxHtmlWindow,
'wxCalendarCtrl': xxxCalendarCtrl,
'wxStaticBoxSizer': xxxStaticBoxSizer,
'wxGridSizer': xxxGridSizer,
'wxFlexGridSizer': xxxFlexGridSizer,
+ 'wxGridBagSizer': xxxGridBagSizer,
'sizeritem': xxxSizerItem,
'spacer': xxxSpacer,
# 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: