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):
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):
# 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
# Just like bitmap
class xxxIcon(xxxObject):
- allParams = ['icon']
- required = ['icon']
+ allParams = []
################################################################################
# Controls
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' ]
+ 'wxSP_NOBORDER', 'wxSP_PERMIT_UNSPLIT', 'wxSP_LIVE_UPDATE',
+ 'wxSP_NO_XP_THEME' ]
class xxxGenericDirCtrl(xxxObject):
allParams = ['defaultfolder', 'filter', 'defaultfilter', 'pos', 'size', 'style']