]> git.saurik.com Git - wxWidgets.git/blob - wxPython/src/_combobox.i
reSWIGged
[wxWidgets.git] / wxPython / src / _combobox.i
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: _combobox.i
3 // Purpose: SWIG interface defs for wxComboBox
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
18 MAKE_CONST_WXSTRING(ComboBoxNameStr);
19
20 //---------------------------------------------------------------------------
21 %newgroup;
22
23
24 DocStr(wxComboBox,
25 "A combobox is like a combination of an edit control and a
26 listbox. It can be displayed as static list with editable or
27 read-only text field; or a drop-down list with text field.
28
29 A combobox permits a single selection only. Combobox items are
30 numbered from zero.", "
31
32 Styles
33 ------
34 ================ ===============================================
35 wx.CB_SIMPLE Creates a combobox with a permanently
36 displayed list. Windows only.
37
38 wx.CB_DROPDOWN Creates a combobox with a drop-down list.
39
40 wx.CB_READONLY Same as wxCB_DROPDOWN but only the strings
41 specified as the combobox choices can be
42 selected, it is impossible to select
43 (even from a program) a string which is
44 not in the choices list.
45
46 wx.CB_SORT Sorts the entries in the list alphabetically.
47 ================ ===============================================
48
49 Events
50 -------
51 ================ ===============================================
52 EVT_COMBOBOX Sent when an item on the list is selected.
53 EVT_TEXT Sent when the combobox text changes.
54 ================ ===============================================
55 ");
56
57
58
59 #ifdef __WXMSW__
60 class wxComboBox : public wxChoice
61 #else
62 class wxComboBox : public wxControl, public wxItemContainer
63 #endif
64 {
65 public:
66 %pythonAppend wxComboBox "self._setOORInfo(self)"
67 %pythonAppend wxComboBox() ""
68
69 DocCtorAStr(
70 wxComboBox(wxWindow* parent, wxWindowID id=-1,
71 const wxString& value = wxPyEmptyString,
72 const wxPoint& pos = wxDefaultPosition,
73 const wxSize& size = wxDefaultSize,
74 const wxArrayString& choices = wxPyEmptyStringArray,
75 long style = 0,
76 const wxValidator& validator = wxDefaultValidator,
77 const wxString& name = wxPyComboBoxNameStr),
78 "__init__(Window parent, int id, String value=EmptyString,
79 Point pos=DefaultPosition, Size size=DefaultSize,
80 List choices=[], long style=0, Validator validator=DefaultValidator,
81 String name=ComboBoxNameStr) -> ComboBox",
82 "Constructor, creates and shows a ComboBox control.", "");
83
84 DocCtorStrName(
85 wxComboBox(),
86 "Precreate a ComboBox control for 2-phase creation.", "",
87 PreComboBox);
88
89
90 DocDeclAStr(
91 bool, Create(wxWindow *parent, wxWindowID id=-1,
92 const wxString& value = wxPyEmptyString,
93 const wxPoint& pos = wxDefaultPosition,
94 const wxSize& size = wxDefaultSize,
95 const wxArrayString& choices = wxPyEmptyStringArray,
96 long style = 0,
97 const wxValidator& validator = wxDefaultValidator,
98 const wxString& name = wxPyChoiceNameStr),
99 "Create(Window parent, int id, String value=EmptyString,
100 Point pos=DefaultPosition, Size size=DefaultSize,
101 List choices=[], long style=0, Validator validator=DefaultValidator,
102 String name=ChoiceNameStr) -> bool",
103 "Actually create the GUI wxComboBox control for 2-phase creation", "");
104
105
106 DocDeclStr(
107 virtual wxString , GetValue() const,
108 "Returns the current value in the combobox text field.", "");
109
110 DocDeclStr(
111 virtual void , SetValue(const wxString& value),
112 "", "");
113
114
115 DocDeclStr(
116 virtual void , Copy(),
117 "Copies the selected text to the clipboard.", "");
118
119 DocDeclStr(
120 virtual void , Cut(),
121 "Copies the selected text to the clipboard and removes the selection.", "");
122
123 DocDeclStr(
124 virtual void , Paste(),
125 "Pastes text from the clipboard to the text field.", "");
126
127
128 DocDeclStr(
129 virtual void , SetInsertionPoint(long pos),
130 "Sets the insertion point in the combobox text field.", "");
131
132 DocDeclStr(
133 virtual long , GetInsertionPoint() const,
134 "Returns the insertion point for the combobox's text field.", "");
135
136 DocDeclStr(
137 virtual long , GetLastPosition() const,
138 "Returns the last position in the combobox text field.", "");
139
140 DocDeclStr(
141 virtual void , Replace(long from, long to, const wxString& value),
142 "Replaces the text between two positions with the given text, in the
143 combobox text field.", "");
144
145 DocDeclStr(
146 void , SetSelection(int n),
147 "Sets the item at index 'n' to be the selected item.", "");
148
149 DocDeclStrName(
150 virtual void , SetSelection(long from, long to),
151 "Selects the text between the two positions in the combobox text field.", "",
152 SetMark);
153
154 DocDeclStr(
155 bool , SetStringSelection(const wxString& string),
156 "Select the item with the specifed string", "");
157
158 DocDeclStr(
159 void , SetString(int n, const wxString& string),
160 "Set the label for the n'th item (zero based) in the list.", "");
161
162 DocDeclStr(
163 virtual void , SetEditable(bool editable),
164 "", "");
165
166
167 DocDeclStr(
168 virtual void , SetInsertionPointEnd(),
169 "Sets the insertion point at the end of the combobox text field.", "");
170
171 DocDeclStr(
172 virtual void , Remove(long from, long to),
173 "Removes the text between the two positions in the combobox text field.", "");
174
175 static wxVisualAttributes
176 GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL);
177 };
178
179 //---------------------------------------------------------------------------