move animate from contrib to core, and migrate to new API
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@41920 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
60
wxPython/demo/AnimateCtrl.py
Normal file
60
wxPython/demo/AnimateCtrl.py
Normal file
@@ -0,0 +1,60 @@
|
||||
|
||||
import wx
|
||||
import wx.animate
|
||||
from Main import opj
|
||||
|
||||
GIFNames = [
|
||||
'bitmaps/AG00178_.gif',
|
||||
'bitmaps/BD13656_.gif',
|
||||
'bitmaps/AG00185_.gif',
|
||||
'bitmaps/AG00039_.gif',
|
||||
'bitmaps/AG00183_.gif',
|
||||
'bitmaps/AG00028_.gif',
|
||||
]
|
||||
|
||||
#----------------------------------------------------------------------
|
||||
|
||||
class TestPanel(wx.Panel):
|
||||
def __init__(self, parent, log):
|
||||
self.log = log
|
||||
wx.Panel.__init__(self, parent, -1)
|
||||
|
||||
sizer = wx.FlexGridSizer(2,3,5,5)
|
||||
for name in GIFNames:
|
||||
ani = wx.animate.Animation(opj(name))
|
||||
ctrl = wx.animate.AnimationCtrl(self, -1, ani)
|
||||
ctrl.SetUseWindowBackgroundColour()
|
||||
ctrl.Play()
|
||||
sizer.Add(ctrl, 0, wx.ALL, 10)
|
||||
|
||||
border = wx.BoxSizer()
|
||||
border.Add(sizer, 1, wx.EXPAND|wx.ALL, 20)
|
||||
self.SetSizer(border)
|
||||
|
||||
|
||||
#----------------------------------------------------------------------
|
||||
|
||||
def runTest(frame, nb, log):
|
||||
win = TestPanel(nb, log)
|
||||
return win
|
||||
|
||||
#----------------------------------------------------------------------
|
||||
|
||||
|
||||
|
||||
overview = """<html><body>
|
||||
<h2><center>wx.animate.AnimationCtrl</center></h2>
|
||||
|
||||
wx.animate.AnimationCtrl is like a wx.StaticBitmap but is able to
|
||||
display an animation by extracing frames from a multi-images GIF file.
|
||||
|
||||
</body></html>
|
||||
"""
|
||||
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
import sys,os
|
||||
import run
|
||||
run.main(['', os.path.basename(sys.argv[0])] + sys.argv[1:])
|
||||
|
@@ -67,6 +67,7 @@ _treeList = [
|
||||
'FlatNotebook',
|
||||
'CustomTreeCtrl',
|
||||
'AboutBox',
|
||||
'AnimateCtrl',
|
||||
]),
|
||||
|
||||
# managed windows == things with a (optional) caption you can close
|
||||
@@ -185,7 +186,6 @@ _treeList = [
|
||||
'FloatBar',
|
||||
'FloatCanvas',
|
||||
'FoldPanelBar',
|
||||
'GIFAnimationCtrl',
|
||||
'HtmlWindow',
|
||||
'HyperLinkCtrl',
|
||||
'IntCtrl',
|
||||
@@ -246,11 +246,11 @@ _treeList = [
|
||||
# Images
|
||||
('Using Images', [
|
||||
## 'AlphaDrawing',
|
||||
'AnimationCtrl',
|
||||
'ArtProvider',
|
||||
'BitmapFromBuffer',
|
||||
'Cursor',
|
||||
'DragImage',
|
||||
'GIFAnimationCtrl',
|
||||
'Image',
|
||||
'ImageAlpha',
|
||||
'ImageFromStream',
|
||||
|
Reference in New Issue
Block a user