A combobox permits a single selection only. Combobox items are numbered from
zero.
- If you need a customized combobox, have a look at wxComboCtrl,
- wxOwnerDrawnComboBox, wxComboPopup
- and the ready-to-use wxBitmapComboBox.
+ If you need a customized combobox, have a look at wxComboCtrl, wxOwnerDrawnComboBox,
+ wxComboPopup and the ready-to-use wxBitmapComboBox.
@beginStyleTable
- @style{wxCB_SIMPLE}:
+ @style{wxCB_SIMPLE}
Creates a combobox with a permanently displayed list. Windows only.
- @style{wxCB_DROPDOWN}:
+ @style{wxCB_DROPDOWN}
Creates a combobox with a drop-down list.
- @style{wxCB_READONLY}:
+ @style{wxCB_READONLY}
Same as wxCB_DROPDOWN but only the strings specified as the
combobox choices can be selected, it is impossible to select (even
from a program) a string which is not in the choices list.
- @style{wxCB_SORT}:
+ @style{wxCB_SORT}
Sorts the entries in the list alphabetically.
- @style{wxTE_PROCESS_ENTER}:
+ @style{wxTE_PROCESS_ENTER}
The control will generate the event wxEVT_COMMAND_TEXT_ENTER
(otherwise pressing Enter key is either processed internally by the
control or used for navigation between dialog controls). Windows
only.
@endStyleTable
- @beginEventTable
- @event{EVT_COMBOBOX(id, func)}:
+ @beginEventTable{wxCommandEvent}
+ @event{EVT_COMBOBOX(id, func)}
Process a wxEVT_COMMAND_COMBOBOX_SELECTED event, when an item on
the list is selected. Note that calling GetValue returns the new
value of selection.
- @event{EVT_TEXT(id, func)}:
+ @event{EVT_TEXT(id, func)}
Process a wxEVT_COMMAND_TEXT_UPDATED event, when the combobox text
changes.
- @event{EVT_TEXT_ENTER(id, func)}:
+ @event{EVT_TEXT_ENTER(id, func)}
Process a wxEVT_COMMAND_TEXT_ENTER event, when RETURN is pressed in
the combobox (notice that the combobox must have been created with
wxTE_PROCESS_ENTER style to receive this event).
@see wxListBox, wxTextCtrl, wxChoice, wxCommandEvent
*/
-class wxComboBox : public wxControlWithItems
+class wxComboBox : public wxControl, public wxItemContainer
{
public:
//@{
/**
Constructor, creating and showing a combobox.
-
+
@param parent
Parent window. Must not be @NULL.
@param id
Window validator.
@param name
Window name.
-
+
@see Create(), wxValidator
*/
wxComboBox();
/**
Returns the insertion point for the combobox's text field.
- @b Note: Under wxMSW, this function always returns 0 if the combobox
+ @note Under wxMSW, this function always returns 0 if the combobox
doesn't have the focus.
*/
long GetInsertionPoint() const;
/**
Removes the text between the two positions in the combobox text field.
-
+
@param from
The first position.
@param to
/**
Replaces the text between two positions with the given text, in the combobox
text field.
-
+
@param from
The first position.
@param to
/**
Sets the insertion point in the combobox text field.
-
+
@param pos
The new insertion point.
*/
/**
Selects the text between the two positions, in the combobox text field.
-
+
@param from
The first position.
@param to
/**
Sets the text for the combobox text field.
- @b NB: For a combobox with @c wxCB_READONLY style the string must be in
- the combobox choices list, otherwise the call to SetValue() is ignored.
-
+
+ @note For a combobox with @c wxCB_READONLY style the string must be in
+ the combobox choices list, otherwise the call to SetValue() is ignored.
+
@param text
The text to set.
*/