Contents Up Previous Next

wxSingleChoiceDialog

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

wxSingleChoiceDialog overview

Members

wxSingleChoiceDialog::wxSingleChoiceDialog
wxSingleChoiceDialog::~wxSingleChoiceDialog
wxSingleChoiceDialog::GetSelection
wxSingleChoiceDialog::GetSelectionClientData
wxSingleChoiceDialog::GetStringSelection
wxSingleChoiceDialog::ShowModal


wxSingleChoiceDialog::wxSingleChoiceDialog

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

pos

Remarks

Use wxSingleChoiceDialog::ShowModal to show the dialog.


wxSingleChoiceDialog::~wxSingleChoiceDialog

~wxSingleChoiceDialog()

Destructor.


wxSingleChoiceDialog::GetSelection

int GetSelection() const

Returns the index of selected item.


wxSingleChoiceDialog::GetSelectionClientData

char* GetSelectionClientData() const

Returns the client data associated with the selection.


wxSingleChoiceDialog::GetStringSelection

wxString GetStringSelection() const

Returns the selected string.


wxSingleChoiceDialog::ShowModal

int ShowModal()

Shows the dialog, returning either wxID_OK or wxID_CANCEL.