]>
Commit | Line | Data |
---|---|---|
1 | ||
2 | import wx | |
3 | import wx.animate | |
4 | from Main import opj | |
5 | ||
6 | GIFNames = [ | |
7 | 'bitmaps/AG00178_.gif', | |
8 | 'bitmaps/BD13656_.gif', | |
9 | 'bitmaps/AG00185_.gif', | |
10 | 'bitmaps/AG00039_.gif', | |
11 | 'bitmaps/AG00183_.gif', | |
12 | 'bitmaps/AG00028_.gif', | |
13 | ] | |
14 | ||
15 | #---------------------------------------------------------------------- | |
16 | ||
17 | class TestPanel(wx.Panel): | |
18 | def __init__(self, parent, log): | |
19 | self.log = log | |
20 | wx.Panel.__init__(self, parent, -1) | |
21 | ||
22 | sizer = wx.FlexGridSizer(2,3,5,5) | |
23 | for name in GIFNames: | |
24 | ani = wx.animate.Animation(opj(name)) | |
25 | ctrl = wx.animate.AnimationCtrl(self, -1, ani) | |
26 | ctrl.SetUseWindowBackgroundColour() | |
27 | ctrl.Play() | |
28 | sizer.Add(ctrl, 0, wx.ALL, 10) | |
29 | ||
30 | border = wx.BoxSizer() | |
31 | border.Add(sizer, 1, wx.EXPAND|wx.ALL, 20) | |
32 | self.SetSizer(border) | |
33 | ||
34 | ||
35 | #---------------------------------------------------------------------- | |
36 | ||
37 | def runTest(frame, nb, log): | |
38 | win = TestPanel(nb, log) | |
39 | return win | |
40 | ||
41 | #---------------------------------------------------------------------- | |
42 | ||
43 | ||
44 | ||
45 | overview = """<html><body> | |
46 | <h2><center>wx.animate.AnimationCtrl</center></h2> | |
47 | ||
48 | wx.animate.AnimationCtrl is like a wx.StaticBitmap but is able to | |
49 | display an animation by extracing frames from a multi-image GIF file. | |
50 | ||
51 | </body></html> | |
52 | """ | |
53 | ||
54 | ||
55 | ||
56 | if __name__ == '__main__': | |
57 | import sys,os | |
58 | import run | |
59 | run.main(['', os.path.basename(sys.argv[0])] + sys.argv[1:]) | |
60 |