]>
git.saurik.com Git - wxWidgets.git/blob - wxPython/demo/AnalogClockWindow.py
1 # 11/4/03 - grimmtooth@softhome.net (Jeff Grimmett)
7 import wx
.lib
.analogclock
as aclock
9 #----------------------------------------------------------------------
11 class TestPanel(wx
.Panel
):
12 def __init__(self
, parent
, log
):
14 wx
.Panel
.__init
__(self
, parent
, -1)
16 # A red background with blue hands and white markings
17 c1
= aclock
.AnalogClockWindow(self
)
18 c1
.SetBackgroundColour("RED")
19 c1
.SetHandsColour("BLUE")
20 c1
.SetTickMarkColours("WHITE")
22 # A white background with red hands and blue markings
23 c2
= aclock
.AnalogClockWindow(self
)
24 c2
.SetBackgroundColour("WHITE")
25 c2
.SetHandsColour("RED")
26 c2
.SetTickMarkColours("BLUE")
28 # A blue background with white hands and red markings
29 c3
= aclock
.AnalogClockWindow(self
)
30 c3
.SetBackgroundColour("BLUE")
31 c3
.SetHandsColour("WHITE")
32 c3
.SetTickMarkColours("RED")
34 # Raised border, circular tick marks.
35 c4
= aclock
.AnalogClockWindow(self
, style
=wx
.RAISED_BORDER
)
36 c4
.SetTickMarkStyle(aclock
.AnalogClockWindow
.TICKS_CIRCLE
)
39 c5
= aclock
.AnalogClockWindow(self
)
40 c5
.SetTickMarkStyle(aclock
.AnalogClockWindow
.TICKS_NONE
)
43 c6
= aclock
.AnalogClockWindow(self
, style
=wx
.SUNKEN_BORDER
)
45 # layout the clocks in a grid sizer
46 gs
= wx
.GridSizer(2, 3, 4, 4)
47 gs
.Add(c1
, 0, wx
.EXPAND
)
48 gs
.Add(c2
, 0, wx
.EXPAND
)
49 gs
.Add(c3
, 0, wx
.EXPAND
)
50 gs
.Add(c4
, 0, wx
.EXPAND
)
51 gs
.Add(c5
, 0, wx
.EXPAND
)
52 gs
.Add(c6
, 0, wx
.EXPAND
)
54 # put it in another sizer for a border
55 sizer
= wx
.BoxSizer(wx
.VERTICAL
)
56 sizer
.Add(gs
, 1, wx
.EXPAND|wx
.ALL
, 10)
61 #----------------------------------------------------------------------
63 def runTest(frame
, nb
, log
):
64 win
= TestPanel(nb
, log
)
67 #----------------------------------------------------------------------
71 overview
= """<html><body>
72 <h2><center>AnalogClockWindow</center></h2>
74 This is a nice little clock class that was contributed to by several
75 members of the wxPython-users group.
80 if __name__
== '__main__':
83 run
.main(['', os
.path
.basename(sys
.argv
[0])])