def value(self):
return self.textNode.data.encode(g.currentEncoding)
def update(self, value):
- self.textNode.data = unicode(value, g.currentEncoding)
+ try: # handle exception if encoding is wrong
+ self.textNode.data = unicode(value, g.currentEncoding)
+ except UnicodeDecodeError:
+ wxLogMessage("Unicode error: set encoding in file\nglobals.py to something appropriate")
# Integer parameter
class xxxParamInt(xxxParam):
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)
else: # simple parameter
self.params[tag] = xxxParam(node)
else:
+ pass
# Remove all other nodes
- element.removeChild(node)
- node.unlink()
+# element.removeChild(node)
+# node.unlink()
+
# Check that all required params are set
for param in self.required:
if not self.params.has_key(param):
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)
# Simulate normal parameter for encoding
class xxxEncoding:
- def __init__(self, val):
- self.encd = val
def value(self):
- return self.encd
+ return g.currentEncoding
def update(self, val):
- self.encd = val
+ g.currentEncoding = val
# Special class for root node
class xxxMainNode(xxxContainer):
# Reset required parameters after processing XML, because encoding is
# a little special
self.required = ['encoding']
- self.params['encoding'] = xxxEncoding(dom.encoding)
+ self.params['encoding'] = xxxEncoding()
################################################################################
# Top-level windwows
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']
# Just like bitmap
class xxxIcon(xxxObject):
- allParams = ['icon']
- required = ['icon']
+ allParams = []
################################################################################
# Controls
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}
paramDict = {'value': ParamInt}
winStyles = ['wxSP_HORIZONTAL', 'wxSP_VERTICAL', 'wxSP_ARROW_KEYS', 'wxSP_WRAP']
+class xxxToggleButton(xxxObject):
+ allParams = ['label', 'checked', 'pos', 'size', 'style']
+ paramDict = {'checked': ParamBool}
+ required = ['label']
+
################################################################################
# Boxes
class xxxCheckBox(xxxObject):
allParams = ['label', 'checked', 'pos', 'size', 'style']
paramDict = {'checked': ParamBool}
+ winStyles = ['wxCHK_2STATE', 'wxCHK_3STATE', 'wxCHK_ALLOW_3RD_STATE_FOR_USER',
+ 'wxALIGN_RIGHT']
required = ['label']
class xxxComboBox(xxxObject):
'wxBitmapButton': xxxBitmapButton,
'wxRadioButton': xxxRadioButton,
'wxSpinButton': xxxSpinButton,
+ 'wxToggleButton' : xxxToggleButton,
'wxStaticBox': xxxStaticBox,
'wxStaticBitmap': xxxStaticBitmap,
'wxScrollBar': xxxScrollBar,
'wxTreeCtrl': xxxTreeCtrl,
'wxListCtrl': xxxListCtrl,
- 'wxCheckList': xxxCheckList,
+ 'wxCheckListBox': xxxCheckList,
'wxNotebook': xxxNotebook,
+ 'wxSplitterWindow': xxxSplitterWindow,
'notebookpage': xxxNotebookPage,
'wxHtmlWindow': xxxHtmlWindow,
'wxCalendarCtrl': xxxCalendarCtrl,