]>
git.saurik.com Git - wxWidgets.git/blob - wxPython/demo/AnalogClockWindow.py
3 import wx
.lib
.analogclock
as aclock
5 #----------------------------------------------------------------------
7 class TestPanel(wx
.Panel
):
8 def __init__(self
, parent
, log
):
10 wx
.Panel
.__init
__(self
, parent
, -1)
12 # A red background with blue hands and white markings
13 c1
= aclock
.AnalogClockWindow(self
)
14 c1
.SetBackgroundColour("RED")
15 c1
.SetHandsColour("BLUE")
16 c1
.SetTickMarkColours("WHITE")
18 # A white background with red hands and blue markings
19 c2
= aclock
.AnalogClockWindow(self
)
20 c2
.SetBackgroundColour("WHITE")
21 c2
.SetHandsColour("RED")
22 c2
.SetTickMarkColours("BLUE")
24 # A blue background with white hands and red markings
25 c3
= aclock
.AnalogClockWindow(self
)
26 c3
.SetBackgroundColour("BLUE")
27 c3
.SetHandsColour("WHITE")
28 c3
.SetTickMarkColours("RED")
30 # Raised border, circular tick marks.
31 c4
= aclock
.AnalogClockWindow(self
, style
=wx
.RAISED_BORDER
)
32 c4
.SetTickMarkStyle(aclock
.AnalogClockWindow
.TICKS_CIRCLE
)
35 c5
= aclock
.AnalogClockWindow(self
)
36 c5
.SetTickMarkStyle(aclock
.AnalogClockWindow
.TICKS_NONE
)
39 c6
= aclock
.AnalogClockWindow(self
, style
=wx
.SUNKEN_BORDER
)
41 # layout the clocks in a grid sizer
42 gs
= wx
.GridSizer(2, 3, 4, 4)
43 gs
.Add(c1
, 0, wx
.EXPAND
)
44 gs
.Add(c2
, 0, wx
.EXPAND
)
45 gs
.Add(c3
, 0, wx
.EXPAND
)
46 gs
.Add(c4
, 0, wx
.EXPAND
)
47 gs
.Add(c5
, 0, wx
.EXPAND
)
48 gs
.Add(c6
, 0, wx
.EXPAND
)
50 # put it in another sizer for a border
51 sizer
= wx
.BoxSizer(wx
.VERTICAL
)
52 sizer
.Add(gs
, 1, wx
.EXPAND|wx
.ALL
, 10)
57 #----------------------------------------------------------------------
59 def runTest(frame
, nb
, log
):
60 win
= TestPanel(nb
, log
)
63 #----------------------------------------------------------------------
67 overview
= """<html><body>
68 <h2><center>AnalogClockWindow</center></h2>
70 This is a nice little clock class that was contributed to by several
71 members of the wxPython-users group.
76 if __name__
== '__main__':
79 run
.main(['', os
.path
.basename(sys
.argv
[0])])