From 609246698d8a7c4a3c6da3ef7dfffaa357c155ea Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Mon, 18 Jun 2018 23:34:45 -0700 Subject: [PATCH] Fix compilation errors due to wxAuiMDIChildFrame deriving from wxTDIChildFrame --- etg/auitabmdi.py | 1 + etg/mdi.py | 22 ++++++++++++++++++++-- 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/etg/auitabmdi.py b/etg/auitabmdi.py index 94391fe1..f130119c 100644 --- a/etg/auitabmdi.py +++ b/etg/auitabmdi.py @@ -42,6 +42,7 @@ def run(): c = module.find('wxAuiMDIChildFrame') + c.bases = ['wxTDIChildFrame'] tools.fixTopLevelWindowClass(c) tools.fixSetStatusWidths(c.find('SetStatusWidths')) c.find('SetMenuBar.menuBar').transfer = True diff --git a/etg/mdi.py b/etg/mdi.py index 4fb9c8a8..ac633d41 100644 --- a/etg/mdi.py +++ b/etg/mdi.py @@ -33,12 +33,30 @@ def run(): # Tweak the parsed meta objects in the module object as needed for # customizing the generated code and docstrings. + # Let the generator know about these intermediate classes even though they + # are undocumented. wxTDIChildFrame is used elsewhere in the class hiearchy + # so it needs to be available. + module.insertItemBefore(module.find('wxMDIClientWindow'), etgtools.WigCode("""\ +class wxMDIChildFrameBase : wxFrame +{ +public: + wxMDIChildFrameBase(); + virtual void Activate() = 0; + wxMDIParentFrame *GetMDIParent() const; + virtual bool IsTopLevel() const; +}; + +class wxTDIChildFrame : wxMDIChildFrameBase /Abstract/ +{ +public: +}; + """)) + c = module.find('wxMDIClientWindow') assert isinstance(c, etgtools.ClassDef) tools.fixWindowClass(c) c.find('CreateClient').isVirtual = True - c = module.find('wxMDIParentFrame') tools.fixTopLevelWindowClass(c) c.find('OnCreateClient').isVirtual = True @@ -48,8 +66,8 @@ def run(): m.type = 'wxMDIClientWindow *' m.setCppCode("return static_cast(self->GetClientWindow());") - c = module.find('wxMDIChildFrame') + c.bases = ['wxMDIChildFrameBase'] tools.fixTopLevelWindowClass(c)