1wxComboBox(3) Erlang Module Definition wxComboBox(3)
2
3
4
6 wxComboBox - Functions for wxComboBox class
7
9 A combobox is like a combination of an edit control and a listbox.
10
11 It can be displayed as static list with editable or read-only text
12 field; or a drop-down list with text field; or a drop-down list without
13 a text field depending on the platform and presence of wxCB_READONLY
14 style.
15
16 A combobox permits a single selection only. Combobox items are numbered
17 from zero.
18
19 If you need a customized combobox, have a look at wxComboCtrl (not im‐
20 plemented in wx), wxOwnerDrawnComboBox (not implemented in wx), wxCom‐
21 boPopup (not implemented in wx) and the ready-to-use wxBitmapComboBox
22 (not implemented in wx).
23
24 Please refer to wxTextEntry (not implemented in wx) documentation for
25 the description of methods operating with the text entry part of the
26 combobox and to wxItemContainer (not implemented in wx) for the methods
27 operating with the list of strings. Notice that at least under MSW wx‐
28 ComboBox doesn't behave correctly if it contains strings differing in
29 case only so portable programs should avoid adding such strings to this
30 control.
31
32 Styles
33
34 This class supports the following styles:
35
36 See: wxListBox, wxTextCtrl, wxChoice, wxCommandEvent
37
38 This class is derived (and can use functions) from: wxControlWithItems
39 wxControl wxWindow wxEvtHandler
40
41 wxWidgets docs: wxComboBox
42
44 Event types emitted from this class: command_combobox_selected, com‐
45 mand_text_updated, command_text_enter, combobox_dropdown, com‐
46 bobox_closeup
47
49 wxComboBox() = wx:wx_object()
50
52 new() -> wxComboBox()
53
54 Default constructor.
55
56 new(Parent, Id) -> wxComboBox()
57
58 Types:
59
60 Parent = wxWindow:wxWindow()
61 Id = integer()
62
63 new(Parent, Id, Options :: [Option]) -> wxComboBox()
64
65 Types:
66
67 Parent = wxWindow:wxWindow()
68 Id = integer()
69 Option =
70 {value, unicode:chardata()} |
71 {pos, {X :: integer(), Y :: integer()}} |
72 {size, {W :: integer(), H :: integer()}} |
73 {choices, [unicode:chardata()]} |
74 {style, integer()} |
75 {validator, wx:wx_object()}
76
77 Constructor, creating and showing a combobox.
78
79 See: create/8, wxValidator (not implemented in wx)
80
81 destroy(This :: wxComboBox()) -> ok
82
83 Destructor, destroying the combobox.
84
85 create(This, Parent, Id, Value, Pos, Size, Choices) -> boolean()
86
87 Types:
88
89 This = wxComboBox()
90 Parent = wxWindow:wxWindow()
91 Id = integer()
92 Value = unicode:chardata()
93 Pos = {X :: integer(), Y :: integer()}
94 Size = {W :: integer(), H :: integer()}
95 Choices = [unicode:chardata()]
96
97 create(This, Parent, Id, Value, Pos, Size, Choices,
98 Options :: [Option]) ->
99 boolean()
100
101 Types:
102
103 This = wxComboBox()
104 Parent = wxWindow:wxWindow()
105 Id = integer()
106 Value = unicode:chardata()
107 Pos = {X :: integer(), Y :: integer()}
108 Size = {W :: integer(), H :: integer()}
109 Choices = [unicode:chardata()]
110 Option = {style, integer()} | {validator, wx:wx_object()}
111
112 canCopy(This) -> boolean()
113
114 Types:
115
116 This = wxComboBox()
117
118 Returns true if the selection can be copied to the clipboard.
119
120 canCut(This) -> boolean()
121
122 Types:
123
124 This = wxComboBox()
125
126 Returns true if the selection can be cut to the clipboard.
127
128 canPaste(This) -> boolean()
129
130 Types:
131
132 This = wxComboBox()
133
134 Returns true if the contents of the clipboard can be pasted into
135 the text control.
136
137 On some platforms (Motif, GTK) this is an approximation and re‐
138 turns true if the control is editable, false otherwise.
139
140 canRedo(This) -> boolean()
141
142 Types:
143
144 This = wxComboBox()
145
146 Returns true if there is a redo facility available and the last
147 operation can be redone.
148
149 canUndo(This) -> boolean()
150
151 Types:
152
153 This = wxComboBox()
154
155 Returns true if there is an undo facility available and the last
156 operation can be undone.
157
158 copy(This) -> ok
159
160 Types:
161
162 This = wxComboBox()
163
164 Copies the selected text to the clipboard.
165
166 cut(This) -> ok
167
168 Types:
169
170 This = wxComboBox()
171
172 Copies the selected text to the clipboard and removes it from
173 the control.
174
175 getInsertionPoint(This) -> integer()
176
177 Types:
178
179 This = wxComboBox()
180
181 Same as wxTextCtrl:getInsertionPoint/1.
182
183 Note: Under wxMSW, this function always returns 0 if the com‐
184 bobox doesn't have the focus.
185
186 getLastPosition(This) -> integer()
187
188 Types:
189
190 This = wxComboBox()
191
192 Returns the zero based index of the last position in the text
193 control, which is equal to the number of characters in the con‐
194 trol.
195
196 getValue(This) -> unicode:charlist()
197
198 Types:
199
200 This = wxComboBox()
201
202 Gets the contents of the control.
203
204 Notice that for a multiline text control, the lines will be sep‐
205 arated by (Unix-style) \n characters, even under Windows where
206 they are separated by a \r\n sequence in the native control.
207
208 paste(This) -> ok
209
210 Types:
211
212 This = wxComboBox()
213
214 Pastes text from the clipboard to the text item.
215
216 redo(This) -> ok
217
218 Types:
219
220 This = wxComboBox()
221
222 If there is a redo facility and the last operation can be re‐
223 done, redoes the last operation.
224
225 Does nothing if there is no redo facility.
226
227 replace(This, From, To, Value) -> ok
228
229 Types:
230
231 This = wxComboBox()
232 From = To = integer()
233 Value = unicode:chardata()
234
235 Replaces the text starting at the first position up to (but not
236 including) the character at the last position with the given
237 text.
238
239 This function puts the current insertion point position at to as
240 a side effect.
241
242 remove(This, From, To) -> ok
243
244 Types:
245
246 This = wxComboBox()
247 From = To = integer()
248
249 Removes the text starting at the first given position up to (but
250 not including) the character at the last position.
251
252 This function puts the current insertion point position at to as
253 a side effect.
254
255 setInsertionPoint(This, Pos) -> ok
256
257 Types:
258
259 This = wxComboBox()
260 Pos = integer()
261
262 Sets the insertion point at the given position.
263
264 setInsertionPointEnd(This) -> ok
265
266 Types:
267
268 This = wxComboBox()
269
270 Sets the insertion point at the end of the text control.
271
272 This is equivalent to calling setInsertionPoint/2 with getLast‐
273 Position/1 argument.
274
275 setSelection(This, N) -> ok
276
277 Types:
278
279 This = wxComboBox()
280 N = integer()
281
282 Sets the selection to the given item n or removes the selection
283 entirely if n == wxNOT_FOUND.
284
285 Note that this does not cause any command events to be emitted
286 nor does it deselect any other items in the controls which sup‐
287 port multiple selections.
288
289 See: wxControlWithItems:setString/3, wxControlWithItems:set‐
290 StringSelection/2
291
292 setSelection(This, From, To) -> ok
293
294 Types:
295
296 This = wxComboBox()
297 From = To = integer()
298
299 Same as wxTextCtrl:setSelection/3.
300
301 setValue(This, Text) -> ok
302
303 Types:
304
305 This = wxComboBox()
306 Text = unicode:chardata()
307
308 Sets the text for the combobox text field.
309
310 For normal, editable comboboxes with a text entry field calling
311 this method will generate a wxEVT_TEXT event, consistently with
312 wxTextCtrl:setValue/2 behaviour, use wxTextCtrl:changeValue/2 if
313 this is undesirable.
314
315 For controls with wxCB_READONLY style the method behaves some‐
316 what differently: the string must be in the combobox choices
317 list (the check for this is case-insensitive) and wxEVT_TEXT is
318 not generated in this case.
319
320 undo(This) -> ok
321
322 Types:
323
324 This = wxComboBox()
325
326 If there is an undo facility and the last operation can be un‐
327 done, undoes the last operation.
328
329 Does nothing if there is no undo facility.
330
331
332
333wxWidgets team. wx 2.2.1 wxComboBox(3)