From 17cf02fadab1062a2ab2f1b3a4bdee70b868b413 Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Mon, 30 Jan 2017 16:05:53 -0800 Subject: [PATCH] Pretend wxAutoBufferedPaintDC derives directly from wxDC --- etg/dcbuffer.py | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/etg/dcbuffer.py b/etg/dcbuffer.py index 4788e9ea..3c0d07a2 100644 --- a/etg/dcbuffer.py +++ b/etg/dcbuffer.py @@ -52,16 +52,17 @@ def run(): c.addPrivateCopyCtor() c.find('wxBufferedPaintDC').findOverload('wxBitmap').find('buffer').keepReference = True - # wxAutoBufferedPaintDC is documented as a class deriving from - # wxBufferedPaintDC, but on some platforms it is just a typedef of - # wxPaintDC. This causes compilation errors when the code tries to - # static_cast<> to one of the buffered DCs, so we'll change the base class - # here to more truly adhere to reality. - c = module.find('wxAutoBufferedPaintDC') - c.mustHaveApp() + # wxAutoBufferedPaintDC is documented as a class deriving from + # wxBufferedPaintDC, but on some platforms it derived directly from + # wxPaintDC. This causes compilation errors when the code tries to + # static_cast<> to a possibly incompatible base class, so we'll take a LCD + # approach and pretend that it derives directly from wxDC instead, in + # order to present a hierarchy that is valid and works on all platforms. + c = module.find('wxAutoBufferedPaintDC') + c.bases = ['wxDC'] + c.mustHaveApp() c.addPrivateCopyCtor() - c.bases = ['wxPaintDC'] module.find('wxAutoBufferedPaintDCFactory').factory = True