]>
Commit | Line | Data |
---|---|---|
d14a1e28 RD |
1 | ///////////////////////////////////////////////////////////////////////////// |
2 | // Name: _choice.i | |
3 | // Purpose: SWIG interface defs for wxChoice | |
4 | // | |
5 | // Author: Robin Dunn | |
6 | // | |
7 | // Created: 10-June-1998 | |
8 | // RCS-ID: $Id$ | |
9 | // Copyright: (c) 2003 by Total Control Software | |
10 | // Licence: wxWindows license | |
11 | ///////////////////////////////////////////////////////////////////////////// | |
12 | ||
13 | // Not a %module | |
14 | ||
15 | ||
16 | //--------------------------------------------------------------------------- | |
17 | ||
b2dc1044 RD |
18 | MAKE_CONST_WXSTRING(ChoiceNameStr); |
19 | ||
d14a1e28 RD |
20 | //--------------------------------------------------------------------------- |
21 | %newgroup; | |
22 | ||
fcafa8a9 RD |
23 | |
24 | DocStr(wxChoice, | |
25 | "A Choice control is used to select one of a list of strings. Unlike a ListBox, | |
26 | only the selection is visible until the user pulls down the menu of choices."); | |
27 | ||
28 | RefDoc(wxChoice, " | |
29 | Events | |
30 | EVT_CHOICE: Sent when an item in the list is selected. | |
31 | "); | |
32 | ||
33 | ||
d14a1e28 RD |
34 | class wxChoice : public wxControlWithItems |
35 | { | |
36 | public: | |
2b9048c5 RD |
37 | %pythonAppend wxChoice "self._setOORInfo(self)" |
38 | %pythonAppend wxChoice() "" | |
d14a1e28 | 39 | |
fcafa8a9 RD |
40 | DocCtorAStr( |
41 | wxChoice(wxWindow *parent, wxWindowID id, | |
42 | const wxPoint& pos = wxDefaultPosition, | |
43 | const wxSize& size = wxDefaultSize, | |
44 | const wxArrayString& choices = wxPyEmptyStringArray, | |
45 | long style = 0, | |
46 | const wxValidator& validator = wxDefaultValidator, | |
47 | const wxString& name = wxPyChoiceNameStr), | |
48 | "__init__(Window parent, int id, Point pos=DefaultPosition, Size size=DefaultSize,\n" | |
49 | " List choices=[], long style=0, Validator validator=DefaultValidator,\n" | |
50 | " String name=ChoiceNameStr) -> Choice", | |
51 | "Create and show a Choice control"); | |
52 | ||
53 | DocCtorStrName( | |
54 | wxChoice(), | |
55 | "Precreate a Choice control for 2-phase creation.", | |
56 | PreChoice); | |
57 | ||
58 | ||
59 | DocDeclAStr( | |
60 | bool, Create(wxWindow *parent, wxWindowID id, | |
61 | const wxPoint& pos = wxDefaultPosition, | |
62 | const wxSize& size = wxDefaultSize, | |
63 | const wxArrayString& choices = wxPyEmptyStringArray, | |
64 | long style = 0, | |
65 | const wxValidator& validator = wxDefaultValidator, | |
66 | const wxString& name = wxPyChoiceNameStr), | |
67 | "Create(Window parent, int id, Point pos=DefaultPosition, Size size=DefaultSize,\n" | |
68 | " List choices=[], long style=0, Validator validator=DefaultValidator,\n" | |
69 | " String name=ChoiceNameStr) -> bool", | |
70 | "Actually create the GUI Choice control for 2-phase creation"); | |
71 | ||
72 | ||
73 | // // These are only meaningful on wxMotif... | |
74 | // int GetColumns(); | |
75 | // void SetColumns(const int n = 1); | |
76 | ||
77 | ||
78 | DocDeclStr( | |
79 | void , SetSelection(const int n), | |
80 | "Select the n'th item (zero based) in the list."); | |
81 | ||
82 | DocDeclStr( | |
83 | void , SetStringSelection(const wxString& string), | |
84 | "Select the item with the specifed string"); | |
85 | ||
86 | DocDeclStr( | |
87 | void , SetString(int n, const wxString& string), | |
88 | "Set the label for the n'th item (zero based) in the list."); | |
89 | ||
90 | ||
91 | %pythoncode { Select = SetSelection } | |
d14a1e28 RD |
92 | }; |
93 | ||
94 | //--------------------------------------------------------------------------- |