]> git.saurik.com Git - wxWidgets.git/blob - wxPython/demo/wxSpinButton.py
added a few virtual keywords for consistency (no real changes) (patch 543922)
[wxWidgets.git] / 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, h),
21 wxSP_VERTICAL)
22 self.spin.SetRange(1, 100)
23 self.spin.SetValue(1)
24
25 EVT_SPIN(self, 20, self.OnSpin)
26
27
28 def OnSpin(self, event):
29 self.text.SetValue(str(event.GetPosition()))
30
31
32 #----------------------------------------------------------------------
33
34 def runTest(frame, nb, log):
35 win = TestPanel(nb, log)
36 return win
37
38 #----------------------------------------------------------------------
39
40
41
42
43
44
45
46
47
48
49 overview = """\
50 """