]> git.saurik.com Git - wxWidgets.git/blob - wxPython/demo/wxGauge.py
Committing in .
[wxWidgets.git] / wxPython / demo / wxGauge.py
1
2 from wxPython.wx import *
3
4 #----------------------------------------------------------------------
5
6 class TestPanel(wxPanel):
7 def __init__(self, parent, log):
8 wxPanel.__init__(self, parent, -1)
9 self.log = log
10 self.count = 0
11
12 wxStaticText(self, -1, "This example shows the wxGauge control.",
13 wxPoint(45, 15))
14
15 self.g1 = wxGauge(self, -1, 50, wxPoint(110, 50), wxSize(250, 25))
16 self.g1.SetBezelFace(3)
17 self.g1.SetShadowWidth(3)
18
19 self.g2 = wxGauge(self, -1, 50, wxPoint(110, 95), wxSize(250, 25),
20 wxGA_HORIZONTAL|wxGA_SMOOTH)
21 self.g2.SetBezelFace(5)
22 self.g2.SetShadowWidth(5)
23
24 EVT_IDLE(self, self.IdleHandler)
25
26
27 def IdleHandler(self, event):
28 self.count = self.count + 1
29 if self.count >= 50:
30 self.count = 0
31 self.g1.SetValue(self.count)
32 self.g2.SetValue(self.count)
33
34
35
36 #----------------------------------------------------------------------
37
38 def runTest(frame, nb, log):
39 win = TestPanel(nb, log)
40 return win
41
42 #----------------------------------------------------------------------
43
44
45
46
47
48
49
50
51
52
53 overview = """\
54 """