diff --git a/etg/_adv.py b/etg/_adv.py index f253860f..b4df4f67 100644 --- a/etg/_adv.py +++ b/etg/_adv.py @@ -45,12 +45,12 @@ INCLUDES = [ 'laywin', 'odcombo', 'bmpcbox', + 'richtooltip', # TODOs - # These modules are also in the C++ adv lib and so should be included here: # - #'richtooltip', #'timectrl', #'treelist', #'wizard', diff --git a/etg/richtooltip.py b/etg/richtooltip.py new file mode 100644 index 00000000..d348002a --- /dev/null +++ b/etg/richtooltip.py @@ -0,0 +1,49 @@ +#--------------------------------------------------------------------------- +# Name: etg/richtooltip.py +# Author: Robin Dunn +# +# Created: 06-Jun-2012 +# Copyright: (c) 2012 by Total Control Software +# License: wxWindows License +#--------------------------------------------------------------------------- + +import etgtools +import etgtools.tweaker_tools as tools + +PACKAGE = "wx" +MODULE = "_adv" +NAME = "richtooltip" # Base name of the file to generate to for this script +DOCSTRING = "" + +# The classes and/or the basename of the Doxygen XML files to be processed by +# this script. +ITEMS = [ "wxRichToolTip", + ] + +#--------------------------------------------------------------------------- + +def run(): + # Parse the XML file(s) building a collection of Extractor objects + module = etgtools.ModuleDef(PACKAGE, MODULE, NAME, DOCSTRING) + etgtools.parseDoxyXML(module, ITEMS) + + #----------------------------------------------------------------- + # Tweak the parsed meta objects in the module object as needed for + # customizing the generated code and docstrings. + + module.addHeaderCode('#include ') + + c = module.find('wxRichToolTip') + assert isinstance(c, etgtools.ClassDef) + c.addPrivateCopyCtor() + + + #----------------------------------------------------------------- + tools.doCommonTweaks(module) + tools.runGenerators(module) + + +#--------------------------------------------------------------------------- +if __name__ == '__main__': + run() + diff --git a/unittests/test_richtooltip.py b/unittests/test_richtooltip.py new file mode 100644 index 00000000..59a7b97d --- /dev/null +++ b/unittests/test_richtooltip.py @@ -0,0 +1,33 @@ +import imp_unittest, unittest +import wtc +import wx +import wx.adv + +#--------------------------------------------------------------------------- + +class richtooltip_Tests(wtc.WidgetTestCase): + + def test_richtooltip1(self): + wx.adv.TipKind_None + wx.adv.TipKind_TopLeft + wx.adv.TipKind_Top + wx.adv.TipKind_TopRight + wx.adv.TipKind_BottomLeft + wx.adv.TipKind_Bottom + wx.adv.TipKind_BottomRight + wx.adv.TipKind_Auto + + + def test_richtooltip2(self): + tt = wx.adv.RichToolTip("The Title", "The richtooltip message.") + tt.SetBackgroundColour('sky blue') + tt.SetIcon(wx.ICON_WARNING) + tt.SetTimeout(200) + tt.ShowFor(self.frame) + self.waitFor(300) + + +#--------------------------------------------------------------------------- + +if __name__ == '__main__': + unittest.main()