This class represents a dialog that shows a list of strings, and allows the user to select one. Double-clicking on a list item is equivalent to single-clicking and then pressing OK.
Derived from
wxDialog
wxWindow
wxEvtHandler
wxObject
Include files
<wx/choicdlg.h>
See also
Members
wxSingleChoiceDialog::wxSingleChoiceDialog
wxSingleChoiceDialog::~wxSingleChoiceDialog
wxSingleChoiceDialog::GetSelection
wxSingleChoiceDialog::GetSelectionClientData
wxSingleChoiceDialog::GetStringSelection
wxSingleChoiceDialog::ShowModal
wxSingleChoiceDialog(wxWindow* parent, const wxString& message, const wxString& caption, int n, const wxString* choices, char** clientData = NULL, long style = wxOK | wxCANCEL | wxCENTRE, const wxPoint& pos = wxDefaultPosition)
Constructor, taking an array of wxString choices and optional client data.
wxSingleChoiceDialog(wxWindow* parent, const wxString& message, const wxString& caption, const wxStringList& choices, char** clientData = NULL, long style = wxOK | wxCANCEL | wxCENTRE, const wxPoint& pos = wxDefaultPosition)
Constructor, taking a string list and optional client data.
Parameters
parent
message
caption
n
choices
style
wxOK | Show an OK button. |
wxCANCEL | Show a Cancel button. |
wxCENTRE | Centre the message. Not Windows. |
pos
Remarks
Use wxSingleChoiceDialog::ShowModal to show the dialog.
~wxSingleChoiceDialog()
Destructor.
int GetSelection() const
Returns the index of selected item.
char* GetSelectionClientData() const
Returns the client data associated with the selection.
wxString GetStringSelection() const
Returns the selected string.
int ShowModal()
Shows the dialog, returning either wxID_OK or wxID_CANCEL.