Ported XRCed to the wx namespace, and also enabled the selected,

focus, and disabled bitmaps of wxBitmapButton to actually be treated
like bitmaps.


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@39174 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robin Dunn
2006-05-17 03:57:57 +00:00
parent 1d88e73a3f
commit 29a41103aa
7 changed files with 626 additions and 629 deletions

View File

@@ -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):
@@ -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)
################################################################################
@@ -649,6 +649,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']
@@ -978,16 +980,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