diff --git a/etg/_adv.py b/etg/_adv.py index 7c5cfc56..8ef1a42f 100644 --- a/etg/_adv.py +++ b/etg/_adv.py @@ -36,12 +36,12 @@ INCLUDES = [ 'taskbar', 'sound', 'joystick', + 'animate', # TODOs - # These modules are also in the C++ adv lib and so should be included here: # - #'animate', #'bannerwindow', #'bmpcbox', #'editlbox', diff --git a/etg/animate.py b/etg/animate.py new file mode 100644 index 00000000..879af7f7 --- /dev/null +++ b/etg/animate.py @@ -0,0 +1,54 @@ +#--------------------------------------------------------------------------- +# Name: etg/animate.py +# Author: Robin Dunn +# +# Created: 21-May-2012 +# Copyright: (c) 2012 by Total Control Software +# License: wxWindows License +#--------------------------------------------------------------------------- + +import etgtools +import etgtools.tweaker_tools as tools + +PACKAGE = "wx" +MODULE = "_adv" +NAME = "animate" # 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 = [ "wxAnimation", + "wxAnimationCtrl", + ] + +#--------------------------------------------------------------------------- + +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. + + c = module.find('wxAnimation') + assert isinstance(c, etgtools.ClassDef) + + c = module.find('wxAnimationCtrl') + tools.fixWindowClass(c) + module.addGlobalStr('wxAnimationCtrlNameStr', c) + + + # TODO: It would be nice to be able to use the generic verison on all + # platforms since the native GTK version has some limitations... + + #----------------------------------------------------------------- + tools.doCommonTweaks(module) + tools.runGenerators(module) + + +#--------------------------------------------------------------------------- +if __name__ == '__main__': + run() + diff --git a/unittests/BD13656_.gif b/unittests/BD13656_.gif new file mode 100644 index 00000000..3cf8d04a Binary files /dev/null and b/unittests/BD13656_.gif differ diff --git a/unittests/test_animate.py b/unittests/test_animate.py new file mode 100644 index 00000000..be57da34 --- /dev/null +++ b/unittests/test_animate.py @@ -0,0 +1,31 @@ +import imp_unittest, unittest +import wtc +import wx +import wx.adv +import os + +gifFile = os.path.join(os.path.dirname(__file__), 'BD13656_.gif') + + +#--------------------------------------------------------------------------- + +class animate_Tests(wtc.WidgetTestCase): + + def test_animate1(self): + ani = wx.adv.Animation() + ani.LoadFile(gifFile) + self.assertTrue(ani.IsOk()) + anictrl = wx.adv.AnimationCtrl(self.frame, anim=ani) + anictrl.Play() + + + def test_animate2(self): + ani = wx.adv.Animation(gifFile) + self.assertTrue(ani.IsOk()) + anictrl = wx.adv.AnimationCtrl(self.frame, anim=ani) + anictrl.Play() + +#--------------------------------------------------------------------------- + +if __name__ == '__main__': + unittest.main()