X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/306b6fe972cccc5022a5ec6096cf94b6b1e0b1cb..68fc5c8025e38b9d827383fbfe7ce509ae331c1f:/wxPython/wx/tools/XRCed/xxx.py?ds=sidebyside diff --git a/wxPython/wx/tools/XRCed/xxx.py b/wxPython/wx/tools/XRCed/xxx.py index 92df22cfe6..781c404814 100644 --- a/wxPython/wx/tools/XRCed/xxx.py +++ b/wxPython/wx/tools/XRCed/xxx.py @@ -40,7 +40,7 @@ class xxxParam(xxxNode): # Use convertion from unicode to current encoding self.textNode = text # Value returns string - if wxUSE_UNICODE: # no conversion is needed + if wx.USE_UNICODE: # no conversion is needed def value(self): return self.textNode.data def update(self, value): @@ -56,7 +56,7 @@ class xxxParam(xxxNode): self.textNode.data = unicode(value, g.currentEncoding) except UnicodeDecodeError: self.textNode.data = unicode(value) - #wxLogMessage("Unicode error: set encoding in file\nglobals.py to something appropriate") + #wx.LogMessage("Unicode error: set encoding in file\nglobals.py to something appropriate") # Integer parameter class xxxParamInt(xxxParam): @@ -90,7 +90,7 @@ class xxxParamContent(xxxNode): text = n.childNodes[0] # first child must be text node assert text.nodeType == minidom.Node.TEXT_NODE l.append(text) - data.append(str(text.data)) + data.append(text.data) else: # remove other node.removeChild(n) n.unlink() @@ -285,7 +285,7 @@ class xxxObject: else: self.element.appendChild(elem) else: - wxLogWarning('Required parameter %s of %s missing' % + wx.LogWarning('Required parameter %s of %s missing' % (param, self.className)) # Returns real tree object def treeObject(self): @@ -338,7 +338,7 @@ def DoFindResource(parent, name, classname, recursive): def FindResource(name, classname='', recursive=True): found = DoFindResource(g.tree.mainNode, name, classname, recursive) if found: return found - wxLogError('XRC resource "%s" not found!' % name) + wx.LogError('XRC resource "%s" not found!' % name) ################################################################################ @@ -475,6 +475,7 @@ class xxxWizard(xxxContainer): default = {'title': ''} winStyles = [] exStyles = ['wxWIZARD_EX_HELPBUTTON'] + styles = ['fg', 'bg', 'font', 'exstyle'] class xxxWizardPage(xxxContainer): allParams = ['bitmap'] @@ -649,6 +650,8 @@ class xxxButton(xxxObject): class xxxBitmapButton(xxxObject): allParams = ['bitmap', 'selected', 'focus', 'disabled', 'default', 'pos', 'size', 'style'] + paramDict = {'selected': ParamBitmap, 'focus': ParamBitmap, 'disabled': ParamBitmap, + 'default': ParamBool} required = ['bitmap'] winStyles = ['wxBU_AUTODRAW', 'wxBU_LEFT', 'wxBU_RIGHT', 'wxBU_TOP', 'wxBU_BOTTOM', 'wxBU_EXACTFIT'] @@ -874,6 +877,11 @@ class xxxSpacer(xxxObject): allParams = ['size', 'option', 'flag', 'border'] paramDict = {'option': ParamInt} default = {'size': '0,0'} + def __init__(self, parent, element, refElem=None): + # For GridBag sizer items, extra parameters added + if isinstance(parent, xxxGridBagSizer): + self.allParams = self.allParams + ['cellpos', 'cellspan'] + xxxObject.__init__(self, parent, element, refElem) class xxxMenuBar(xxxContainer): allParams = ['style'] @@ -973,16 +981,16 @@ 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(), - 'cellpos': wxNewId(), 'cellspan': wxNewId() +paramIDs = {'fg': wx.NewId(), 'bg': wx.NewId(), 'exstyle': wx.NewId(), 'font': wx.NewId(), + 'enabled': wx.NewId(), 'focused': wx.NewId(), 'hidden': wx.NewId(), + 'tooltip': wx.NewId(), 'encoding': wx.NewId(), + 'cellpos': wx.NewId(), 'cellspan': wx.NewId() } for cl in xxxDict.values(): if cl.allParams: for param in cl.allParams + cl.paramDict.keys(): if not paramIDs.has_key(param): - paramIDs[param] = wxNewId() + paramIDs[param] = wx.NewId() ################################################################################ # Helper functions