]> git.saurik.com Git - wxWidgets.git/blob - utils/wxPython/demo/wxSpinButton.py
Final tweaks for 2.1b1
[wxWidgets.git] / utils / wxPython / demo / wxSpinButton.py
1
2 from wxPython.wx import *
3
4 import string
5
6 #----------------------------------------------------------------------
7
8 class TestPanel(wxPanel):
9 def __init__(self, parent, log):
10 wxPanel.__init__(self, parent, -1)
11 self.log = log
12 self.count = 0
13
14 wxStaticText(self, -1, "This example uses the wxSpinButton control.",
15 wxPoint(45, 15))
16
17
18 self.text = wxTextCtrl(self, -1, "1", wxPoint(30, 50), wxSize(60, -1))
19 h = self.text.GetSize().height
20 self.spin = wxSpinButton(self, 20, wxPoint(92, 50), wxSize(h*2, h))
21 self.spin.SetRange(1, 100)
22 self.spin.SetValue(1)
23
24 EVT_SPIN(self, 20, self.OnSpin)
25
26
27 def OnSpin(self, event):
28 self.text.SetValue(str(event.GetPosition()))
29
30
31 #----------------------------------------------------------------------
32
33 def runTest(frame, nb, log):
34 win = TestPanel(nb, log)
35 return win
36
37 #----------------------------------------------------------------------
38
39
40
41
42
43
44
45
46
47
48 overview = """\
49 """