mirror of
https://github.com/wxWidgets/Phoenix.git
synced 2025-12-16 01:30:07 +01:00
Add wx.adv.AnimationCtrl
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxPython/Phoenix/trunk@71529 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -36,12 +36,12 @@ INCLUDES = [
|
|||||||
'taskbar',
|
'taskbar',
|
||||||
'sound',
|
'sound',
|
||||||
'joystick',
|
'joystick',
|
||||||
|
'animate',
|
||||||
|
|
||||||
|
|
||||||
# TODOs -
|
# TODOs -
|
||||||
# These modules are also in the C++ adv lib and so should be included here:
|
# These modules are also in the C++ adv lib and so should be included here:
|
||||||
#
|
#
|
||||||
#'animate',
|
|
||||||
#'bannerwindow',
|
#'bannerwindow',
|
||||||
#'bmpcbox',
|
#'bmpcbox',
|
||||||
#'editlbox',
|
#'editlbox',
|
||||||
|
|||||||
54
etg/animate.py
Normal file
54
etg/animate.py
Normal file
@@ -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()
|
||||||
|
|
||||||
BIN
unittests/BD13656_.gif
Normal file
BIN
unittests/BD13656_.gif
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 13 KiB |
31
unittests/test_animate.py
Normal file
31
unittests/test_animate.py
Normal file
@@ -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()
|
||||||
Reference in New Issue
Block a user