]> git.saurik.com Git - wxWidgets.git/blob - wxPython/demo/AnalogClockWindow.py
Shell Script file to copy setup.h for ProjectBuilder
[wxWidgets.git] / wxPython / demo / AnalogClockWindow.py
1
2
3
4 from wxPython.wx import *
5 from wxPython.lib.analogclock import AnalogClockWindow
6
7 #----------------------------------------------------------------------
8
9 class TestPanel(wxPanel):
10 def __init__(self, parent, log):
11 self.log = log
12 wxPanel.__init__(self, parent, -1)
13
14 c1 = AnalogClockWindow(self)
15 c1.SetBackgroundColour("RED")
16 c1.SetHandsColour("BLUE")
17 c1.SetTickMarkColours("WHITE")
18
19 c2 = AnalogClockWindow(self)
20 c2.SetBackgroundColour("WHITE")
21 c2.SetHandsColour("RED")
22 c2.SetTickMarkColours("BLUE")
23
24 c3 = AnalogClockWindow(self)
25 c3.SetBackgroundColour("BLUE")
26 c3.SetHandsColour("WHITE")
27 c3.SetTickMarkColours("RED")
28
29 c4 = AnalogClockWindow(self, style=wxRAISED_BORDER)
30 c4.SetTickMarkStyle(AnalogClockWindow.TICKS_CIRCLE)
31
32 c5 = AnalogClockWindow(self)
33 c5.SetTickMarkStyle(AnalogClockWindow.TICKS_NONE)
34
35 c6 = AnalogClockWindow(self, style=wxSUNKEN_BORDER)
36
37
38 # layout the clocks in a grid
39 gs = wxGridSizer(2, 3, 4, 4)
40 gs.Add(c1, 0, wxEXPAND)
41 gs.Add(c2, 0, wxEXPAND)
42 gs.Add(c3, 0, wxEXPAND)
43 gs.Add(c4, 0, wxEXPAND)
44 gs.Add(c5, 0, wxEXPAND)
45 gs.Add(c6, 0, wxEXPAND)
46
47 # put it in another sizer for a border
48 sizer = wxBoxSizer(wxVERTICAL)
49 sizer.Add(gs, 1, wxEXPAND|wxALL, 10)
50
51 self.SetSizer(sizer)
52
53
54 #----------------------------------------------------------------------
55
56 def runTest(frame, nb, log):
57 win = TestPanel(nb, log)
58 return win
59
60 #----------------------------------------------------------------------
61
62
63
64 overview = """<html><body>
65 <h2><center>AnalogClockWindow</center></h2>
66
67 This is a nice little clock class that was contributed to by several
68 members of the wxPython-users group.
69
70 </body></html>
71 """
72
73
74
75 if __name__ == '__main__':
76 import sys,os
77 import run
78 run.main(['', os.path.basename(sys.argv[0])])
79