Patch #1710943, Fix a bug in pywxrc script for "MenuBar" and "Menu"
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_8_BRANCH@45747 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -89,12 +89,19 @@ class xrc%(windowName)s(wx.%(windowClass)s):
|
|||||||
pre.thisown = 0
|
pre.thisown = 0
|
||||||
if hasattr(self, '_setOORInfo'):
|
if hasattr(self, '_setOORInfo'):
|
||||||
self._setOORInfo(self)
|
self._setOORInfo(self)
|
||||||
if hasattr(self, '_setCallbackInfo'):
|
|
||||||
self._setCallbackInfo(self, self.__class__)
|
|
||||||
|
|
||||||
# Define variables for the menu items
|
# Define variables for the menu items
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
MENUBAR_CLASS_HEADER = """\
|
||||||
|
class xrc%(windowName)s(wx.%(windowClass)s):
|
||||||
|
def __init__(self):
|
||||||
|
pre = get_resources().LoadMenuBar("%(windowName)s")
|
||||||
|
self.PostCreate(pre)
|
||||||
|
|
||||||
|
# Define variables for the menu items
|
||||||
|
"""
|
||||||
|
|
||||||
CREATE_MENUITEM_VAR = """\
|
CREATE_MENUITEM_VAR = """\
|
||||||
self.%(widgetName)s = self.FindItemById(xrc.XRCID(\"%(widgetName)s\"))
|
self.%(widgetName)s = self.FindItemById(xrc.XRCID(\"%(widgetName)s\"))
|
||||||
"""
|
"""
|
||||||
@@ -227,7 +234,9 @@ class XmlResourceCompiler:
|
|||||||
windowClass = re.sub("^wx", "", windowClass)
|
windowClass = re.sub("^wx", "", windowClass)
|
||||||
windowName = topWindow.getAttribute("name")
|
windowName = topWindow.getAttribute("name")
|
||||||
|
|
||||||
if windowClass in ["Menu", "MenuItem"]:
|
if windowClass in ["MenuBar"]:
|
||||||
|
outputList.append(self.templates.MENUBAR_CLASS_HEADER % locals())
|
||||||
|
elif windowClass in ["Menu"]:
|
||||||
outputList.append(self.templates.MENU_CLASS_HEADER % locals())
|
outputList.append(self.templates.MENU_CLASS_HEADER % locals())
|
||||||
else:
|
else:
|
||||||
outputList.append(self.templates.CLASS_HEADER % locals())
|
outputList.append(self.templates.CLASS_HEADER % locals())
|
||||||
|
Reference in New Issue
Block a user