Construct and ClassDef for wxXmlSubclassFactory instead of just inserting the text for the declaration.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxPython/Phoenix/trunk@73783 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robin Dunn
2013-04-05 04:04:59 +00:00
parent a5a432fc1f
commit 10a1ffb4bd

View File

@@ -9,7 +9,8 @@
import etgtools
import etgtools.tweaker_tools as tools
from etgtools import PyFunctionDef, PyCodeDef, PyPropertyDef
from etgtools import PyFunctionDef, PyCodeDef, PyPropertyDef,\
ClassDef, MethodDef, ParamDef
PACKAGE = "wx"
MODULE = "_xrc"
@@ -151,19 +152,22 @@ def run():
module.addPyFunction('XRCCTRL', '(window, str_id, *ignoreargs)',
doc='Returns the child window associated with the string ID in an XML resource.',
body='return window.FindWindowById(XRCID(str_id))')
module.addItem(etgtools.WigCode("""\
class wxXmlSubclassFactory
{
public:
wxXmlSubclassFactory();
virtual ~wxXmlSubclassFactory();
virtual wxObject *Create(const wxString& className) = 0;
};"""))
cls = ClassDef(name='wxXmlSubclassFactory',
briefDoc="",
items=[
MethodDef(name='wxXmlSubclassFactory', isCtor=True),
MethodDef(name='~wxXmlSubclassFactory', isDtor=True),
MethodDef(name='Create', type='wxObject*',
isVirtual=True, isPureVirtual=True,
items=[ParamDef(type='const wxString&', name='className')])
])
module.addItem(cls)
module.addPyCode("""\
# Create a factory for handling the subclass property of XRC's
# object tag. This factory will search for the specified