From 704bb8a301f59b16bc52dfbcf6f541bd8a193bae Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Mon, 29 Oct 2018 19:39:28 -0700 Subject: [PATCH] Ensure sip knows the pure virtuals are present in wx.html.HtmlPrintout --- CHANGES.rst | 3 +++ etg/htmlprint.py | 8 ++++++++ unittests/test_htmlprint.py | 2 ++ 3 files changed, 13 insertions(+) diff --git a/CHANGES.rst b/CHANGES.rst index 0ca8e469..731b2a23 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -135,6 +135,9 @@ Changes in this release include the following: * wxWidgets for Mac includes the wxJoystick class now, also update the demo. (#997) +* Fix wx.html.HtmlPrintout to not be seen as an abstract class, so it can be + instantiated. (#1060) + diff --git a/etg/htmlprint.py b/etg/htmlprint.py index 5e15d905..e0c30cb0 100644 --- a/etg/htmlprint.py +++ b/etg/htmlprint.py @@ -52,6 +52,14 @@ def run(): c.addPrivateCopyCtor() tools.fixHtmlSetFonts(c) + # Ensure sip knows these virtuals are present in this class. + c.addItem(etgtools.WigCode("""\ + bool OnPrintPage(int page); + bool HasPage(int page); + void GetPageInfo(int *minPage, int *maxPage, int *selPageFrom, int *selPageTo); + bool OnBeginDocument(int startPage, int endPage); + void OnPreparePrinting(); + """)) #----------------------------------------------------------------- tools.doCommonTweaks(module) diff --git a/unittests/test_htmlprint.py b/unittests/test_htmlprint.py index 65c33a70..25bc9fef 100644 --- a/unittests/test_htmlprint.py +++ b/unittests/test_htmlprint.py @@ -24,6 +24,8 @@ class htmlprint_Tests(wtc.WidgetTestCase): hep = wx.html.HtmlEasyPrinting(parentWindow=self.frame) hep.SetFonts('', '', [7,8,10,12,16,22,30]) + def test_htmlprint3(self): + po = wx.html.HtmlPrintout() #---------------------------------------------------------------------------