]> git.saurik.com Git - wxWidgets.git/blame_incremental - wxPython/demo/SpinCtrl.py
Add IsValid()
[wxWidgets.git] / wxPython / demo / SpinCtrl.py
... / ...
CommitLineData
1
2import wx
3
4#----------------------------------------------------------------------
5
6class TestPanel(wx.Panel):
7 def __init__(self, parent, log):
8 wx.Panel.__init__(self, parent, -1)
9 self.log = log
10 self.count = 0
11
12 wx.StaticText(self, -1, "This example uses the wx.SpinCtrl control.", (45, 15))
13 sc = wx.SpinCtrl(self, -1, "", (30, 50))
14 sc.SetRange(1,100)
15 sc.SetValue(5)
16
17
18#----------------------------------------------------------------------
19
20def runTest(frame, nb, log):
21 win = TestPanel(nb, log)
22 return win
23
24#----------------------------------------------------------------------
25
26
27overview = """\
28wx.SpinCtrl combines wx.TextCtrl and wx.SpinButton in one control.
29
30Portable programs should try to use this control as wx.SpinButton is not
31implemented for all platforms (Win32 and GTK only currently).
32
33NB: the range supported by this control depends on the platform
34but is at least -0x8000 to 0x7fff. Under GTK and Win32 with sufficiently new version
35of comctrl32.dll (at least 4.71 is required, 5.80 is recommended) the full 32 bit
36range is supported.
37
38
39"""
40
41
42if __name__ == '__main__':
43 import sys,os
44 import run
45 run.main(['', os.path.basename(sys.argv[0])] + sys.argv[1:])