## wxMultiChoiceDialog

This class represents a dialog that shows a list of strings, and allows the user to select one or more.

Derived from

wxDialog
wxWindow
wxEvtHandler
wxObject

Include files

<wx/choicdlg.h>

See also

wxMultiChoiceDialog overview, wxSingleChoiceDialog

Members

wxMultiChoiceDialog::wxMultiChoiceDialog
wxMultiChoiceDialog::GetSelections
wxMultiChoiceDialog::SetSelections
wxMultiChoiceDialog::ShowModal

### wxMultiChoiceDialog::wxMultiChoiceDialog

wxMultiChoiceDialog(wxWindow* parent, const wxString& message, const wxString& caption, int n, const wxString* choices, long style = wxCHOICEDLG_STYLE, const wxPoint& pos = wxDefaultPosition)

wxMultiChoiceDialog(wxWindow* parent, const wxString& message, const wxString& caption, const wxArrayString& choices, long style = wxCHOICEDLG_STYLE, const wxPoint& pos = wxDefaultPosition)

Constructor taking an array of wxString choices.

Parameters

parent

Parent window.

message

Message to show on the dialog.

caption

The dialog caption.

n

The number of choices.

choices

An array of strings, or a string list, containing the choices.

style

A dialog style (bitlist) containing flags chosen from standard dialog styles and the following:

wxOK | Show an OK button.
wxCANCEL | Show a Cancel button.
wxCENTRE | Centre the message. Not Windows.

The default value is equivalent to wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER | wxOK | wxCANCEL | wxCENTRE.

pos

Dialog position. Not Windows.

Remarks

Use wxMultiChoiceDialog::ShowModal to show the dialog.

wxPython note: For Python the two parameters `n` and `choices` are collapsed into a multi parameter `choices` which is expected to be a Python list of strings.

wxPerl note: In wxPerl there is just an array reference in place of `n`.

### wxMultiChoiceDialog::GetSelections

wxArrayInt GetSelections() const

Returns array with indexes of selected items.

### wxMultiChoiceDialog::SetSelections

void SetSelections(const wxArrayInt& selections) const

Sets selected items from the array of selected items' indexes.

### wxMultiChoiceDialog::ShowModal

int ShowModal()

Shows the dialog, returning either wxID_OK or wxID_CANCEL.