wxComboBox

wxComboBox

wxComboBox
Functions for wxComboBox class

A combobox is like a combination of an edit control and a listbox.

It can be displayed as static list with editable or read-only text field; or a drop-down list with text field; or a drop-down list without a text field depending on the platform and presence of wxCB_READONLY style.

A combobox permits a single selection only. Combobox items are numbered from zero.

If you need a customized combobox, have a look at wxComboCtrl (not implemented in wx), wxOwnerDrawnComboBox (not implemented in wx), wxComboPopup (not implemented in wx) and the ready-to-use wxBitmapComboBox (not implemented in wx).

Please refer to wxTextEntry (not implemented in wx) documentation for the description of methods operating with the text entry part of the combobox and to wxItemContainer (not implemented in wx) for the methods operating with the list of strings. Notice that at least under MSW wxComboBox doesn't behave correctly if it contains strings differing in case only so portable programs should avoid adding such strings to this control.

Styles

This class supports the following styles:

See: wxListBox, wxTextCtrl, wxChoice, wxCommandEvent

This class is derived (and can use functions) from: wxControlWithItems wxControl wxWindow wxEvtHandler

wxWidgets docs: wxComboBox

Destructor, destroying the combobox.

Types

Returns true if the selection can be copied to the clipboard.

Types

Returns true if the selection can be cut to the clipboard.

Types

Returns true if the contents of the clipboard can be pasted into the text control.

On some platforms (Motif, GTK) this is an approximation and returns true if the control is editable, false otherwise.

Types

Returns true if there is a redo facility available and the last operation can be redone.

Types

Returns true if there is an undo facility available and the last operation can be undone.

Types

Copies the selected text to the clipboard.

Types

Copies the selected text to the clipboard and removes it from the control.

Types

Returns the zero based index of the last position in the text control, which is equal to the number of characters in the control.

Types

Gets the contents of the control.

Notice that for a multiline text control, the lines will be separated by (Unix-style) \n characters, even under Windows where they are separated by a \r\n sequence in the native control.

Types

Pastes text from the clipboard to the text item.

Types

If there is a redo facility and the last operation can be redone, redoes the last operation.

Does nothing if there is no redo facility.

Types

From = To = integer()

Replaces the text starting at the first position up to (but not including) the character at the last position with the given text.

This function puts the current insertion point position at to as a side effect.

Types

From = To = integer()

Removes the text starting at the first given position up to (but not including) the character at the last position.

This function puts the current insertion point position at to as a side effect.

Types

Pos = integer()

Sets the insertion point at the given position.

Types

Sets the text for the combobox text field.

For normal, editable comboboxes with a text entry field calling this method will generate a wxEVT_TEXT event, consistently with wxTextCtrl:setValue/2 behaviour, use wxTextCtrl:changeValue/2 if this is undesirable.

For controls with wxCB_READONLY style the method behaves somewhat differently: the string must be in the combobox choices list (the check for this is case-insensitive) and wxEVT_TEXT is not generated in this case.

Types

If there is an undo facility and the last operation can be undone, undoes the last operation.

Does nothing if there is no undo facility.