diff --git a/etg/htmlcell.py b/etg/htmlcell.py index 5f4049b1..8b8c9ed9 100644 --- a/etg/htmlcell.py +++ b/etg/htmlcell.py @@ -44,10 +44,12 @@ def run(): c = module.find('wxHtmlCell') assert isinstance(c, etgtools.ClassDef) c.addPrivateCopyCtor() - c.find('SetNext.cell').transfer = True c.find('AdjustPagebreak.pagebreak').inOut = True + + c = module.find('wxHtmlContainerCell') + c.find('InsertCell.cell').transfer = True #----------------------------------------------------------------- tools.doCommonTweaks(module) diff --git a/etg/htmldefs.py b/etg/htmldefs.py index d978daa7..f629838e 100644 --- a/etg/htmldefs.py +++ b/etg/htmldefs.py @@ -18,7 +18,6 @@ DOCSTRING = "" # The classes and/or the basename of the Doxygen XML files to be processed by # this script. ITEMS = [ "htmldefs_8h.xml", - ] #--------------------------------------------------------------------------- @@ -35,6 +34,7 @@ def run(): #c = module.find('') #assert isinstance(c, etgtools.ClassDef) + module.addItem(etgtools.DefineDef(name='INT_MAX', value='11111')) #----------------------------------------------------------------- tools.doCommonTweaks(module) diff --git a/etg/htmlfilt.py b/etg/htmlfilt.py index 6481b9c2..cc764439 100644 --- a/etg/htmlfilt.py +++ b/etg/htmlfilt.py @@ -25,7 +25,7 @@ ITEMS = [ "wxHtmlFilter", def run(): # Parse the XML file(s) building a collection of Extractor objects - module = etgtools.ModuleDef(PACKAGE, MODULE, NAME, DOCSTRING) + module = etgtools.ModuleDef(PACKAGE, MODULE, NAME, DOCSTRING, check4unittest=False) etgtools.parseDoxyXML(module, ITEMS) #----------------------------------------------------------------- diff --git a/etg/htmlprint.py b/etg/htmlprint.py index 4f48de36..f7fe075c 100644 --- a/etg/htmlprint.py +++ b/etg/htmlprint.py @@ -21,7 +21,7 @@ ITEMS = [ "wxHtmlDCRenderer", "wxHtmlEasyPrinting", "wxHtmlPrintout", ] - + #--------------------------------------------------------------------------- def run(): @@ -38,6 +38,9 @@ def run(): c.addPrivateCopyCtor() tools.fixHtmlSetFonts(c) + c.find('Render.from').name = 'from_' + c.find('Render.to').name = 'to_' + c = module.find('wxHtmlEasyPrinting') c.addPrivateCopyCtor() diff --git a/etg/htmltag.py b/etg/htmltag.py index 6a615b7d..eaa22fb0 100644 --- a/etg/htmltag.py +++ b/etg/htmltag.py @@ -25,7 +25,7 @@ ITEMS = [ "wxHtmlTag", def run(): # Parse the XML file(s) building a collection of Extractor objects - module = etgtools.ModuleDef(PACKAGE, MODULE, NAME, DOCSTRING) + module = etgtools.ModuleDef(PACKAGE, MODULE, NAME, DOCSTRING, check4unittest=False) etgtools.parseDoxyXML(module, ITEMS) #----------------------------------------------------------------- diff --git a/etg/htmlwinpars.py b/etg/htmlwinpars.py index b6c6aee0..62450262 100644 --- a/etg/htmlwinpars.py +++ b/etg/htmlwinpars.py @@ -50,6 +50,10 @@ def run(): c.find('AddModule').ignore() + c.addItem(etgtools.WigCode("""\ + virtual wxObject* GetProduct(); + """)) + module.addCppCode("""\ class wxPyHtmlTagsModule : public wxHtmlTagsModule { @@ -58,7 +62,7 @@ def run(): m_tagHandlerClass = thc; wxPyThreadBlocker blocker; Py_INCREF(m_tagHandlerClass); - RegisterModule(this); + RegisterModule(this); wxHtmlWinParser::AddModule(this); } @@ -70,11 +74,9 @@ def run(): PyObject* obj = (PyObject*)m_objArray.Item(x); Py_DECREF(obj); } - }; + } void FillHandlersTable(wxHtmlWinParser *parser) { - // Wave our magic wand... (if it works it's a miracle! ;-) - wxPyThreadBlocker blocker; wxHtmlWinTagHandler* thPtr = 0; // First, make a new instance of the tag handler @@ -107,6 +109,7 @@ def run(): // Dynamically create a new wxModule. Refcounts tagHandlerClass // and adds itself to the wxModules list and to the wxHtmlWinParser. new wxPyHtmlTagsModule(tagHandlerClass); + wxModule::InitializeModules(); """) diff --git a/unittests/test_htmlcell.py b/unittests/test_htmlcell.py index d0a90a8b..f0466d6d 100644 --- a/unittests/test_htmlcell.py +++ b/unittests/test_htmlcell.py @@ -1,14 +1,36 @@ import imp_unittest, unittest import wtc import wx +import wx.html + #--------------------------------------------------------------------------- class htmlcell_Tests(wtc.WidgetTestCase): - # TODO: Remove this test and add real ones. def test_htmlcell1(self): - self.fail("Unit tests for htmlcell not implemented yet.") + c = wx.html.HtmlCell() + + def test_htmlcell2(self): + obj = wx.html.HtmlSelection() + + def test_htmlcell3(self): + obj = wx.html.HtmlRenderingState() + + def test_htmlcell4(self): + obj = wx.html.HtmlRenderingInfo() + + def test_htmlcell5(self): + obj = wx.html.HtmlContainerCell(None) + + def test_htmlcell6(self): + obj = wx.html.HtmlLinkInfo() + + def test_htmlcell7(self): + obj = wx.html.HtmlColourCell(wx.BLACK) + + def test_htmlcell8(self): + obj = wx.html.HtmlWidgetCell(self.frame) #--------------------------------------------------------------------------- diff --git a/unittests/test_htmldefs.py b/unittests/test_htmldefs.py index 8e2f72de..659a290f 100644 --- a/unittests/test_htmldefs.py +++ b/unittests/test_htmldefs.py @@ -60,7 +60,12 @@ class htmldefs_Tests(wtc.WidgetTestCase): wx.html.HTML_COND_ISIMAGEMAP wx.html.HTML_COND_USER - + wx.html.HTML_FIND_EXACT + wx.html.HTML_FIND_NEAREST_BEFORE + wx.html.HTML_FIND_NEAREST_AFTER + wx.html.HTML_SCRIPT_NORMAL + wx.html.HTML_SCRIPT_SUB + wx.html.HTML_SCRIPT_SUP #--------------------------------------------------------------------------- diff --git a/unittests/test_htmlfilt.py b/unittests/test_htmlfilt.py deleted file mode 100644 index f2fdf707..00000000 --- a/unittests/test_htmlfilt.py +++ /dev/null @@ -1,16 +0,0 @@ -import imp_unittest, unittest -import wtc -import wx - -#--------------------------------------------------------------------------- - -class htmlfilt_Tests(wtc.WidgetTestCase): - - # TODO: Remove this test and add real ones. - def test_htmlfilt1(self): - self.fail("Unit tests for htmlfilt not implemented yet.") - -#--------------------------------------------------------------------------- - -if __name__ == '__main__': - unittest.main() diff --git a/unittests/test_htmlpars.py b/unittests/test_htmlpars.py index d9242070..c87ff2fc 100644 --- a/unittests/test_htmlpars.py +++ b/unittests/test_htmlpars.py @@ -1,15 +1,28 @@ import imp_unittest, unittest import wtc import wx +import wx.html #--------------------------------------------------------------------------- class htmlpars_Tests(wtc.WidgetTestCase): - # TODO: Remove this test and add real ones. def test_htmlpars1(self): - self.fail("Unit tests for htmlpars not implemented yet.") + class myTagHandler(wx.html.HtmlTagHandler): + def __init__(self): + wx.html.HtmlTagHandler.__init__(self) + self.test = None + + def GetSupportedTags(self): + return 'FOO,BAR' + + def HandleTag(self, tag): + self.test = tag.GetTagName() + + wx.html.HtmlWinParser_AddTagHandler(myTagHandler) + self.myYield() + #--------------------------------------------------------------------------- if __name__ == '__main__': diff --git a/unittests/test_htmlprint.py b/unittests/test_htmlprint.py index 0696b568..8e46985e 100644 --- a/unittests/test_htmlprint.py +++ b/unittests/test_htmlprint.py @@ -1,14 +1,24 @@ import imp_unittest, unittest import wtc import wx +import wx.html #--------------------------------------------------------------------------- class htmlprint_Tests(wtc.WidgetTestCase): - # TODO: Remove this test and add real ones. - def test_htmlprint1(self): - self.fail("Unit tests for htmlprint not implemented yet.") + def test_htmlprint1(self): + size = (100,100) + bmp = wx.Bitmap(*size) + dc = wx.MemoryDC(bmp) + + obj = wx.html.HtmlDCRenderer() + obj.SetDC(dc) + obj.SetSize(*size) + obj.SetHtmlText('

Hello World

') + + obj.Render(0,0, []) + #--------------------------------------------------------------------------- diff --git a/unittests/test_htmltag.py b/unittests/test_htmltag.py deleted file mode 100644 index 0435eac2..00000000 --- a/unittests/test_htmltag.py +++ /dev/null @@ -1,16 +0,0 @@ -import imp_unittest, unittest -import wtc -import wx - -#--------------------------------------------------------------------------- - -class htmltag_Tests(wtc.WidgetTestCase): - - # TODO: Remove this test and add real ones. - def test_htmltag1(self): - self.fail("Unit tests for htmltag not implemented yet.") - -#--------------------------------------------------------------------------- - -if __name__ == '__main__': - unittest.main() diff --git a/unittests/test_htmlwin.py b/unittests/test_htmlwin.py index 15370ddd..c58da3bf 100644 --- a/unittests/test_htmlwin.py +++ b/unittests/test_htmlwin.py @@ -1,14 +1,48 @@ import imp_unittest, unittest import wtc import wx +import wx.html + +import os +helpPath = os.path.join(os.path.dirname(__file__), 'helpfiles') #--------------------------------------------------------------------------- class htmlwin_Tests(wtc.WidgetTestCase): - # TODO: Remove this test and add real ones. def test_htmlwin1(self): - self.fail("Unit tests for htmlwin not implemented yet.") + obj = wx.html.HtmlWindow(self.frame) + + def test_htmlwin2(self): + obj = wx.html.HtmlWindow() + obj.Create(self.frame) + + def test_htmlwin3(self): + obj = wx.html.HtmlWindow(self.frame) + obj.LoadFile(os.path.join(helpPath, 'main.htm')) + self.frame.SendSizeEvent() + self.myYield() + + + def test_htmlwin4(self): + noLog = wx.LogNull() + obj = wx.html.HtmlWindow(self.frame) + obj.LoadPage('http://www.google.com/') + self.frame.SendSizeEvent() + self.myYield() + + + def test_htmlwin5(self): + obj = wx.html.HtmlWindow(self.frame) + obj.SetPage("Hello, world!") + self.frame.SendSizeEvent() + self.myYield() + + def test_htmlwin6(self): + obj = wx.html.HtmlWindow(self.frame) + self.frame.SendSizeEvent() + self.myYield() + #--------------------------------------------------------------------------- diff --git a/unittests/test_htmlwinpars.py b/unittests/test_htmlwinpars.py index d11020c5..2ca827ee 100644 --- a/unittests/test_htmlwinpars.py +++ b/unittests/test_htmlwinpars.py @@ -1,14 +1,14 @@ import imp_unittest, unittest import wtc import wx +import wx.html #--------------------------------------------------------------------------- class htmlwinpars_Tests(wtc.WidgetTestCase): - # TODO: Remove this test and add real ones. def test_htmlwinpars1(self): - self.fail("Unit tests for htmlwinpars not implemented yet.") + obj = wx.html.HtmlWinParser() #--------------------------------------------------------------------------- diff --git a/unittests/test_pi_import.py b/unittests/test_pi_import.py index d7c7622f..1d406838 100644 --- a/unittests/test_pi_import.py +++ b/unittests/test_pi_import.py @@ -39,6 +39,9 @@ class PIImportTest(unittest.TestCase): def test_stc_pi(self): self.runPI('stc.pi') + + def test_html_pi(self): + self.runPI('html.pi') #---------------------------------------------------------------------------