]>
git.saurik.com Git - wxWidgets.git/blob - wxPython/demo/AnalogClockWindow.py
4 from wxPython
.wx
import *
5 from wxPython
.lib
.analogclock
import AnalogClockWindow
7 #----------------------------------------------------------------------
9 class TestPanel(wxPanel
):
10 def __init__(self
, parent
, log
):
12 wxPanel
.__init
__(self
, parent
, -1)
14 c1
= AnalogClockWindow(self
)
15 c1
.SetBackgroundColour("RED")
16 c1
.SetHandsColour("BLUE")
17 c1
.SetTickMarkColours("WHITE")
19 c2
= AnalogClockWindow(self
)
20 c2
.SetBackgroundColour("WHITE")
21 c2
.SetHandsColour("RED")
22 c2
.SetTickMarkColours("BLUE")
24 c3
= AnalogClockWindow(self
)
25 c3
.SetBackgroundColour("BLUE")
26 c3
.SetHandsColour("WHITE")
27 c3
.SetTickMarkColours("RED")
29 c4
= AnalogClockWindow(self
, style
=wxRAISED_BORDER
)
30 c4
.SetTickMarkStyle(AnalogClockWindow
.TICKS_CIRCLE
)
32 c5
= AnalogClockWindow(self
)
33 c5
.SetTickMarkStyle(AnalogClockWindow
.TICKS_NONE
)
35 c6
= AnalogClockWindow(self
, style
=wxSUNKEN_BORDER
)
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
)
47 # put it in another sizer for a border
48 sizer
= wxBoxSizer(wxVERTICAL
)
49 sizer
.Add(gs
, 1, wxEXPAND|wxALL
, 10)
54 #----------------------------------------------------------------------
56 def runTest(frame
, nb
, log
):
57 win
= TestPanel(nb
, log
)
60 #----------------------------------------------------------------------
64 overview
= """<html><body>
65 <h2><center>AnalogClockWindow</center></h2>
67 This is a nice little clock class that was contributed to by several
68 members of the wxPython-users group.
75 if __name__
== '__main__':
78 run
.main(['', os
.path
.basename(sys
.argv
[0])])