diff --git a/etg/richtexthtml.py b/etg/richtexthtml.py index ab523ca0..468411f3 100644 --- a/etg/richtexthtml.py +++ b/etg/richtexthtml.py @@ -32,9 +32,15 @@ def run(): # Tweak the parsed meta objects in the module object as needed for # customizing the generated code and docstrings. - #c = module.find('wxRichTextHTMLHandler') - #assert isinstance(c, etgtools.ClassDef) + c = module.find('wxRichTextHTMLHandler') + assert isinstance(c, etgtools.ClassDef) + # Let SIP know that the pure virtuals have implementations in this class + c.addItem(etgtools.WigCode("""\ + protected: + virtual bool DoLoadFile(wxRichTextBuffer *buffer, wxInputStream& stream); + virtual bool DoSaveFile(wxRichTextBuffer *buffer, wxOutputStream& stream); + """)) #----------------------------------------------------------------- tools.doCommonTweaks(module) diff --git a/etg/richtextprint.py b/etg/richtextprint.py index cee1bac7..69e9a81b 100644 --- a/etg/richtextprint.py +++ b/etg/richtextprint.py @@ -38,7 +38,16 @@ def run(): tools.ignoreAllOperators(c) + c = module.find('wxRichTextPrintout') + assert isinstance(c, etgtools.ClassDef) + c.find('GetPageInfo.minPage').out = True + c.find('GetPageInfo.maxPage').out = True + c.find('GetPageInfo.selPageFrom').out = True + c.find('GetPageInfo.selPageTo').out = True + + c = module.find('wxRichTextPrinting') + assert isinstance(c, etgtools.ClassDef) c.addPrivateCopyCtor() diff --git a/unittests/test_richtextformatdlg.py b/unittests/test_richtextformatdlg.py index 773ed7fe..1b7eb483 100644 --- a/unittests/test_richtextformatdlg.py +++ b/unittests/test_richtextformatdlg.py @@ -1,14 +1,27 @@ import imp_unittest, unittest import wtc import wx +import wx.richtext #--------------------------------------------------------------------------- class richtextformatdlg_Tests(wtc.WidgetTestCase): - # TODO: Remove this test and add real ones. + @unittest.expectedFailure # richtextformatdlg not implemented yet def test_richtextformatdlg1(self): - self.fail("Unit tests for richtextformatdlg not implemented yet.") + wx.richtext.RICHTEXT_FORMAT_FONT + wx.richtext.RICHTEXT_FORMAT_TABS + wx.richtext.RICHTEXT_FORMAT_STYLE_EDITOR + wx.richtext.RICHTEXT_FORMAT_BULLETS + wx.richtext.RICHTEXT_FORMAT_INDENTS_SPACING + + + @unittest.expectedFailure # richtextformatdlg not implemented yet + def test_richtextformatdlg2(self): + dlg = wx.richtext.RichTextFormattingDialog( + wx.richtext.RICHTEXT_FORMAT_FONT, + self.frame) + self.runDialog(dlg) #--------------------------------------------------------------------------- diff --git a/unittests/test_richtexthtml.py b/unittests/test_richtexthtml.py index 7cace884..ac13d0c3 100644 --- a/unittests/test_richtexthtml.py +++ b/unittests/test_richtexthtml.py @@ -1,14 +1,18 @@ import imp_unittest, unittest import wtc import wx +import wx.richtext #--------------------------------------------------------------------------- class richtexthtml_Tests(wtc.WidgetTestCase): - # TODO: Remove this test and add real ones. def test_richtexthtml1(self): - self.fail("Unit tests for richtexthtml not implemented yet.") + + handler = wx.richtext.RichTextHTMLHandler() + wx.richtext.RichTextBuffer.AddHandler(handler) + + #--------------------------------------------------------------------------- diff --git a/unittests/test_richtextprint.py b/unittests/test_richtextprint.py index cef3fb24..5fbf956a 100644 --- a/unittests/test_richtextprint.py +++ b/unittests/test_richtextprint.py @@ -1,15 +1,32 @@ import imp_unittest, unittest import wtc import wx +import wx.richtext #--------------------------------------------------------------------------- class richtextprint_Tests(wtc.WidgetTestCase): - # TODO: Remove this test and add real ones. def test_richtextprint1(self): - self.fail("Unit tests for richtextprint not implemented yet.") + wx.richtext.RICHTEXT_PAGE_ODD + wx.richtext.RICHTEXT_PAGE_EVEN + wx.richtext.RICHTEXT_PAGE_ALL + wx.richtext.RICHTEXT_PAGE_LEFT + wx.richtext.RICHTEXT_PAGE_CENTRE + wx.richtext.RICHTEXT_PAGE_RIGHT + + def test_richtextprint2(self): + hfd = wx.richtext.RichTextHeaderFooterData() + + + def test_richtextprint3(self): + p = wx.richtext.RichTextPrintout() + + + def test_richtextprint4(self): + p = wx.richtext.RichTextPrinting() + #--------------------------------------------------------------------------- if __name__ == '__main__': diff --git a/unittests/test_richtextstyledlg.py b/unittests/test_richtextstyledlg.py index 95106928..e0bc9561 100644 --- a/unittests/test_richtextstyledlg.py +++ b/unittests/test_richtextstyledlg.py @@ -1,14 +1,50 @@ import imp_unittest, unittest import wtc import wx +import wx.richtext #--------------------------------------------------------------------------- class richtextstyledlg_Tests(wtc.WidgetTestCase): - # TODO: Remove this test and add real ones. - def test_richtextstyledlg1(self): - self.fail("Unit tests for richtextstyledlg not implemented yet.") + + def test_richtextstyledlg1(self): + wx.richtext.RICHTEXT_ORGANISER_DELETE_STYLES + wx.richtext.RICHTEXT_ORGANISER_CREATE_STYLES + wx.richtext.RICHTEXT_ORGANISER_APPLY_STYLES + wx.richtext.RICHTEXT_ORGANISER_EDIT_STYLES + wx.richtext.RICHTEXT_ORGANISER_RENAME_STYLES + wx.richtext.RICHTEXT_ORGANISER_OK_CANCEL + wx.richtext.RICHTEXT_ORGANISER_RENUMBER + wx.richtext.RICHTEXT_ORGANISER_SHOW_CHARACTER + wx.richtext.RICHTEXT_ORGANISER_SHOW_PARAGRAPH + wx.richtext.RICHTEXT_ORGANISER_SHOW_LIST + wx.richtext.RICHTEXT_ORGANISER_SHOW_BOX + wx.richtext.RICHTEXT_ORGANISER_SHOW_ALL + wx.richtext.RICHTEXT_ORGANISER_ORGANISE + wx.richtext.RICHTEXT_ORGANISER_BROWSE + wx.richtext.RICHTEXT_ORGANISER_BROWSE_NUMBERING + + + def test_richtextstyledlg2(self): + sheet = wx.richtext.RichTextStyleSheet() + rtc = wx.richtext.RichTextCtrl(self.frame) + + dlg = wx.richtext.RichTextStyleOrganiserDialog( + wx.richtext.RICHTEXT_ORGANISER_ORGANISE, + sheet, rtc, self.frame) + dlg.Destroy() + + + def test_richtextstyledlg3(self): + sheet = wx.richtext.RichTextStyleSheet() + rtc = wx.richtext.RichTextCtrl(self.frame) + + dlg = wx.richtext.RichTextStyleOrganiserDialog() + dlg.Create(wx.richtext.RICHTEXT_ORGANISER_ORGANISE, + sheet, rtc, self.frame) + dlg.Destroy() + #---------------------------------------------------------------------------