1 \section{\class{wxSingleChoiceDialog
}}\label{wxsinglechoicedialog
}
3 This class represents a dialog that shows a list of strings, and allows the
4 user to select one. Double-clicking on a list item is equivalent to
5 single-clicking and then pressing OK.
7 \wxheading{Derived from
}
9 \helpref{wxDialog
}{wxdialog
}\\
10 \helpref{wxWindow
}{wxwindow
}\\
11 \helpref{wxEvtHandler
}{wxevthandler
}\\
12 \helpref{wxObject
}{wxobject
}
14 \wxheading{Include files
}
20 \helpref{wxSingleChoiceDialog overview
}{wxsinglechoicedialogoverview
},
21 \helpref{wxMultiChoiceDialog
}{wxmultichoicedialog
}
23 \latexignore{\rtfignore{\wxheading{Members
}}}
25 \membersection{wxSingleChoiceDialog::wxSingleChoiceDialog
}\label{wxsinglechoicedialogconstr
}
27 \func{}{wxSingleChoiceDialog
}{\param{wxWindow*
}{parent
},
\param{const wxString\&
}{message
},
\rtfsp
28 \param{const wxString\&
}{caption
},
\param{int
}{n
},
\param{const wxString*
}{choices
},
\rtfsp
29 \param{void**
}{ clientData = NULL
},
\param{long
}{style = wxCHOICEDLG
\_STYLE},
\rtfsp
30 \param{const wxPoint\&
}{pos = wxDefaultPosition
}}
32 \func{}{wxSingleChoiceDialog
}{\param{wxWindow*
}{parent
},
\param{const wxString\&
}{message
},
\rtfsp
33 \param{const wxString\&
}{caption
},
\param{const wxArrayString\&
}{choices
},
\rtfsp
34 \param{void**
}{ clientData = NULL
},
\param{long
}{style = wxCHOICEDLG
\_STYLE},
\rtfsp
35 \param{const wxPoint\&
}{pos = wxDefaultPosition
}}
37 Constructor, taking an array of wxString choices and optional client data.
39 \wxheading{Parameters
}
41 \docparam{parent
}{Parent window.
}
43 \docparam{message
}{Message to show on the dialog.
}
45 \docparam{caption
}{The dialog caption.
}
47 \docparam{n
}{The number of choices.
}
49 \docparam{choices
}{An array of strings, or a string list, containing the choices.
}
51 \docparam{clientData
}{An array of client data to be associated with the items.
52 See
\helpref{GetSelectionClientData
}{wxsinglechoicedialoggetselectionclientdata
}.
}
54 \docparam{style
}{A dialog style (bitlist) containing flags chosen from standard
55 dialog styles and the following:
59 \twocolitem{{\bf wxOK
}}{Show an OK button.
}
60 \twocolitem{{\bf wxCANCEL
}}{Show a Cancel button.
}
61 \twocolitem{{\bf wxCENTRE
}}{Centre the message. Not Windows.
}
63 The default value is equivalent to
{\bf wxDEFAULT
\_DIALOG\_STYLE \pipe wxRESIZE
\_BORDER \pipe wxOK
\pipe wxCANCEL
\pipe wxCENTRE
}.
66 \docparam{pos
}{Dialog position. Not Windows.
}
70 Use
\helpref{wxSingleChoiceDialog::ShowModal
}{wxsinglechoicedialogshowmodal
} to show the dialog.
72 \pythonnote{For Python the two parameters
{\tt n
} and
{\tt choices
} are collapsed
73 into a single parameter
{\tt choices
} which is expected to be a Python
76 \perlnote{In wxPerl there is just an array reference in place of
{\tt n
}
77 and
{\tt choices
}, and the client data array, if present, must have the
78 same length as the choices array.
}
80 \membersection{wxSingleChoiceDialog::GetSelection
}
82 \constfunc{int
}{GetSelection
}{\void}
84 Returns the index of selected item.
86 \membersection{wxSingleChoiceDialog::GetSelectionClientData
}\label{wxsinglechoicedialoggetselectionclientdata
}
88 \constfunc{char*
}{GetSelectionClientData
}{\void}
90 Returns the client data associated with the selection.
92 \membersection{wxSingleChoiceDialog::GetStringSelection
}
94 \constfunc{wxString
}{GetStringSelection
}{\void}
96 Returns the selected string.
98 \membersection{wxSingleChoiceDialog::SetSelection
}
100 \constfunc{void
}{SetSelection
}{\param{int
}{ selection
}}
102 Sets the index of the initially selected item.
104 \membersection{wxSingleChoiceDialog::ShowModal
}\label{wxsinglechoicedialogshowmodal
}
106 \func{int
}{ShowModal
}{\void}
108 Shows the dialog, returning either wxID
\_OK or wxID
\_CANCEL.