From 45990bae2f86efc9ebca804e0fb0d29e3160e779 Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Sun, 25 Sep 2011 04:09:16 +0000 Subject: [PATCH] For .setCppCode fixes git-svn-id: https://svn.wxwidgets.org/svn/wx/wxPython/Phoenix/trunk@69188 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- etg/dataobj.py | 2 +- etg/layout.py | 2 +- etg/menu.py | 18 ++++++++++-------- 3 files changed, 12 insertions(+), 10 deletions(-) diff --git a/etg/dataobj.py b/etg/dataobj.py index 7b798045..95c3c16e 100644 --- a/etg/dataobj.py +++ b/etg/dataobj.py @@ -35,7 +35,7 @@ def run(): c = module.find('wxDataFormat') assert isinstance(c, etgtools.ClassDef) - c.find('GetType').setCppCode("sipRes = static_cast(sipCpp->GetType());") + c.find('GetType').setCppCode("return static_cast(self->GetType());") #----------------------------------------------------------------- tools.doCommonTweaks(module) diff --git a/etg/layout.py b/etg/layout.py index 2f0403ab..0bb88a6d 100644 --- a/etg/layout.py +++ b/etg/layout.py @@ -36,7 +36,7 @@ def run(): c = module.find('wxIndividualLayoutConstraint') assert isinstance(c, etgtools.ClassDef) - c.find('GetOtherWindow').setCppCode('sipRes = (wxWindow*)sipCpp->GetOtherWindow();') + c.find('GetOtherWindow').setCppCode('return (wxWindow*)self->GetOtherWindow();') c.addProperty('Done GetDone SetDone') c.addProperty('Margin GetMargin SetMargin') diff --git a/etg/menu.py b/etg/menu.py index abdf4f8b..1ae9364a 100644 --- a/etg/menu.py +++ b/etg/menu.py @@ -50,17 +50,19 @@ def run(): c.find('wxMenuBar').findOverload('wxMenu *menus[], const wxString titles[], long style=0)').ignore() c.find('FindItem').ignore() mac_scmb = c.find('MacSetCommonMenuBar') - mac_scmb.setCppCode(""" -#ifdef __WXMAC__ - wxMenuBar::MacSetCommonMenuBar(menubar); -#endif + mac_scmb.setCppCode("""\ + #ifdef __WXMAC__ + wxMenuBar::MacSetCommonMenuBar(menubar); + #endif """) mac_gcmb = c.find('MacGetCommonMenuBar') - mac_gcmb.setCppCode(""" -#ifdef __WXMAC__ - sipRes = wxMenuBar::MacGetCommonMenuBar(); -#endif + mac_gcmb.setCppCode("""\ + #ifdef __WXMAC__ + return wxMenuBar::MacGetCommonMenuBar(); + #else + return NULL; + #endif """) # don't transfer on other platforms, as this is a no-op there.