]> git.saurik.com Git - wxWidgets.git/blob - wxPython/demo/wxChoice.py
fixed wxWindow::SetCursor( wxNullCursor) for mac
[wxWidgets.git] / wxPython / demo / wxChoice.py
1
2 from wxPython.wx import *
3
4 #---------------------------------------------------------------------------
5
6 class TestChoice(wxPanel):
7 def __init__(self, parent, log):
8 self.log = log
9 wxPanel.__init__(self, parent, -1)
10
11 sampleList = ['zero', 'one', 'two', 'three', 'four', 'five',
12 'six', 'seven', 'eight']
13
14 wxStaticText(self, -1, "This example uses the wxChoice control.",
15 wxPoint(15, 10))
16
17 wxStaticText(self, -1, "Select one:", wxPoint(15, 50), wxSize(75, 20))
18 wxChoice(self, 40, (80, 50), (95, 125),
19 choices = sampleList)
20 EVT_CHOICE(self, 40, self.EvtChoice)
21
22 def EvtChoice(self, event):
23 self.log.WriteText('EvtChoice: %s\n' % event.GetString())
24
25 #---------------------------------------------------------------------------
26
27 def runTest(frame, nb, log):
28 win = TestChoice(nb, log)
29 return win
30
31 #---------------------------------------------------------------------------
32
33
34
35
36
37
38
39
40
41
42
43
44 overview = """\
45 A choice item is used to select one of a list of strings. Unlike a listbox, only the selection is visible until the user pulls down the menu of choices.
46
47 wxChoice()
48 -------------------
49
50 Default constructor.
51
52 wxChoice(wxWindow *parent, wxWindowID id, const wxPoint& pos, const wxSize& size, int n, const wxString choices[], long style = 0, const wxValidator& validator = wxDefaultValidator, const wxString& name = "choice")
53
54 Constructor, creating and showing a choice.
55
56 Parameters
57 -------------------
58
59 parent = Parent window. Must not be NULL.
60
61 id = Window identifier. A value of -1 indicates a default value.
62
63 pos = Window position.
64
65 size = Window size. If the default size (-1, -1) is specified then the choice is sized appropriately.
66
67 n = Number of strings with which to initialise the choice control.
68
69 choices = An array of strings with which to initialise the choice control.
70
71 style = Window style. See wxChoice.
72
73 validator = Window validator.
74
75 name = Window name.
76 """