#include <wx/combobox.h>

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.
Styles:
The following event handler macros redirect the events to member function handlers 'func' with prototypes like:
Public Member Functions | |
| wxComboBox () | |
| ~wxComboBox () | |
| bool | CanCopy () const |
| bool | CanCut () const |
| bool | CanPaste () const |
| bool | CanRedo () const |
| bool | CanUndo () const |
| void | Copy () |
| void | Cut () |
| int | GetCurrentSelection () const |
| long | GetInsertionPoint () const |
| virtual wxTextPos | GetLastPosition () const |
| void | GetSelection (long *from, long *to) const |
| wxString | GetValue () const |
| void | Paste () |
| void | Redo () |
| void | Remove (long from, long to) |
| void | Replace (long from, long to, const wxString &text) |
| void | SetInsertionPoint (long pos) |
| void | SetInsertionPointEnd () |
| void | SetSelection (long from, long to) |
| void | SetValue (const wxString &text) |
| void | Undo () |
| wxComboBox (wxWindow *parent, wxWindowID id, const wxString &value="", const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, int n=0, const wxString choices[]=NULL, long style=0, const wxValidator &validator=wxDefaultValidator, const wxString &name="comboBox") | |
| wxComboBox (wxWindow *parent, wxWindowID id, const wxString &value, const wxPoint &pos, const wxSize &size, const wxArrayString &choices, long style=0, const wxValidator &validator=wxDefaultValidator, const wxString &name="comboBox") | |
| bool | Create (wxWindow *parent, wxWindowID id, const wxString &value="", const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, int n, const wxString choices[], long style=0, const wxValidator &validator=wxDefaultValidator, const wxString &name="comboBox") |
| bool | Create (wxWindow *parent, wxWindowID id, const wxString &value, const wxPoint &pos, const wxSize &size, const wxArrayString &choices, long style=0, const wxValidator &validator=wxDefaultValidator, const wxString &name="comboBox") |
| wxComboBox::wxComboBox | ( | ) |
Default constructor.
| wxComboBox::wxComboBox | ( | wxWindow * | parent, | |
| wxWindowID | id, | |||
| const wxString & | value = "", |
|||
| const wxPoint & | pos = wxDefaultPosition, |
|||
| const wxSize & | size = wxDefaultSize, |
|||
| int | n = 0, |
|||
| const wxString | choices[] = NULL, |
|||
| long | style = 0, |
|||
| const wxValidator & | validator = wxDefaultValidator, |
|||
| const wxString & | name = "comboBox" | |||
| ) |
Constructor, creating and showing a combobox.
| parent | Parent window. Must not be NULL. | |
| id | Window identifier. The value wxID_ANY indicates a default value. | |
| value | Initial selection string. An empty string indicates no selection. | |
| pos | Window position. | |
| size | Window size. If wxDefaultSize is specified then the window is sized appropriately. | |
| n | Number of strings with which to initialise the control. | |
| choices | An array of strings with which to initialise the control. | |
| style | Window style. See wxComboBox. | |
| validator | Window validator. | |
| name | Window name. |
| wxComboBox::wxComboBox | ( | wxWindow * | parent, | |
| wxWindowID | id, | |||
| const wxString & | value, | |||
| const wxPoint & | pos, | |||
| const wxSize & | size, | |||
| const wxArrayString & | choices, | |||
| long | style = 0, |
|||
| const wxValidator & | validator = wxDefaultValidator, |
|||
| const wxString & | name = "comboBox" | |||
| ) |
Constructor, creating and showing a combobox.
| parent | Parent window. Must not be NULL. | |
| id | Window identifier. The value wxID_ANY indicates a default value. | |
| value | Initial selection string. An empty string indicates no selection. | |
| pos | Window position. | |
| size | Window size. If wxDefaultSize is specified then the window is sized appropriately. | |
| n | Number of strings with which to initialise the control. | |
| choices | An array of strings with which to initialise the control. | |
| style | Window style. See wxComboBox. | |
| validator | Window validator. | |
| name | Window name. |
| wxComboBox::~wxComboBox | ( | ) |
Destructor, destroying the combobox.
| bool wxComboBox::Create | ( | wxWindow * | parent, | |
| wxWindowID | id, | |||
| const wxString & | value = "", |
|||
| const wxPoint & | pos = wxDefaultPosition, |
|||
| const wxSize & | size = wxDefaultSize, |
|||
| int | n, | |||
| const wxString | choices[], | |||
| long | style = 0, |
|||
| const wxValidator & | validator = wxDefaultValidator, |
|||
| const wxString & | name = "comboBox" | |||
| ) |
Creates the combobox for two-step construction. Derived classes should call or replace this function. See wxComboBox() for further details.
Reimplemented in wxBitmapComboBox.
| bool wxComboBox::Create | ( | wxWindow * | parent, | |
| wxWindowID | id, | |||
| const wxString & | value, | |||
| const wxPoint & | pos, | |||
| const wxSize & | size, | |||
| const wxArrayString & | choices, | |||
| long | style = 0, |
|||
| const wxValidator & | validator = wxDefaultValidator, |
|||
| const wxString & | name = "comboBox" | |||
| ) |
Creates the combobox for two-step construction. Derived classes should call or replace this function. See wxComboBox() for further details.
Reimplemented in wxBitmapComboBox.
| bool wxComboBox::CanCopy | ( | ) | const |
Returns true if the combobox is editable and there is a text selection to copy to the clipboard. Only available on Windows.
| bool wxComboBox::CanCut | ( | ) | const |
Returns true if the combobox is editable and there is a text selection to copy to the clipboard. Only available on Windows.
| bool wxComboBox::CanPaste | ( | ) | const |
Returns true if the combobox is editable and there is text on the clipboard that can be pasted into the text field. Only available on Windows.
| bool wxComboBox::CanRedo | ( | ) | const |
Returns true if the combobox is editable and the last undo can be redone. Only available on Windows.
| bool wxComboBox::CanUndo | ( | ) | const |
Returns true if the combobox is editable and the last edit can be undone. Only available on Windows.
| void wxComboBox::Copy | ( | ) |
Copies the selected text to the clipboard.
| void wxComboBox::Cut | ( | ) |
Copies the selected text to the clipboard and removes the selection.
| int wxComboBox::GetCurrentSelection | ( | ) | const |
This function does the same things as wxChoice::GetCurrentSelection() and returns the item currently selected in the dropdown list if it's open or the same thing as wxControlWithItems::GetSelection() otherwise.
| long wxComboBox::GetInsertionPoint | ( | ) | const |
Returns the insertion point for the combobox's text field.
| virtual wxTextPos wxComboBox::GetLastPosition | ( | ) | const [virtual] |
Returns the last position in the combobox text field.
| void wxComboBox::GetSelection | ( | long * | from, | |
| long * | to | |||
| ) | const |
This is the same as wxTextCtrl::GetSelection() for the text control which is part of the combobox. Notice that this is a different method from wxControlWithItems::GetSelection().
Currently this method is only implemented in wxMSW and wxGTK.
| wxString wxComboBox::GetValue | ( | ) | const |
Returns the current value in the combobox text field.
| void wxComboBox::Paste | ( | ) |
Pastes text from the clipboard to the text field.
| void wxComboBox::Redo | ( | ) |
Redoes the last undo in the text field. Windows only.
| void wxComboBox::Remove | ( | long | from, | |
| long | to | |||
| ) |
Removes the text between the two positions in the combobox text field.
| from | The first position. | |
| to | The last position. |
| void wxComboBox::Replace | ( | long | from, | |
| long | to, | |||
| const wxString & | text | |||
| ) |
Replaces the text between two positions with the given text, in the combobox text field.
| from | The first position. | |
| to | The second position. | |
| text | The text to insert. |
| void wxComboBox::SetInsertionPoint | ( | long | pos | ) |
Sets the insertion point in the combobox text field.
| pos | The new insertion point. |
| void wxComboBox::SetInsertionPointEnd | ( | ) |
Sets the insertion point at the end of the combobox text field.
| void wxComboBox::SetSelection | ( | long | from, | |
| long | to | |||
| ) |
Selects the text between the two positions, in the combobox text field.
| from | The first position. | |
| to | The second position. |
| void wxComboBox::SetValue | ( | const wxString & | text | ) |
Sets the text for the combobox text field.
wxCB_READONLY style the string must be in the combobox choices list, otherwise the call to SetValue() is ignored.| text | The text to set. |
| void wxComboBox::Undo | ( | ) |
Undoes the last edit in the text field. Windows only.
|
[ top ] |