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{wxTopLevelWindow
}{wxtoplevelwindow
}\\
11 \helpref{wxWindow
}{wxwindow
}\\
12 \helpref{wxEvtHandler
}{wxevthandler
}\\
13 \helpref{wxObject
}{wxobject
}
15 \wxheading{Include files
}
21 \helpref{wxSingleChoiceDialog overview
}{wxsinglechoicedialogoverview
},
22 \helpref{wxMultiChoiceDialog
}{wxmultichoicedialog
}
24 \latexignore{\rtfignore{\wxheading{Members
}}}
26 \membersection{wxSingleChoiceDialog::wxSingleChoiceDialog
}\label{wxsinglechoicedialogctor
}
28 \func{}{wxSingleChoiceDialog
}{\param{wxWindow*
}{parent
},
\param{const wxString\&
}{message
},
\rtfsp
29 \param{const wxString\&
}{caption
},
\param{int
}{n
},
\param{const wxString*
}{choices
},
\rtfsp
30 \param{void**
}{ clientData = NULL
},
\param{long
}{style = wxCHOICEDLG
\_STYLE},
\rtfsp
31 \param{const wxPoint\&
}{pos = wxDefaultPosition
}}
33 \func{}{wxSingleChoiceDialog
}{\param{wxWindow*
}{parent
},
\param{const wxString\&
}{message
},
\rtfsp
34 \param{const wxString\&
}{caption
},
\param{const wxArrayString\&
}{choices
},
\rtfsp
35 \param{void**
}{ clientData = NULL
},
\param{long
}{style = wxCHOICEDLG
\_STYLE},
\rtfsp
36 \param{const wxPoint\&
}{pos = wxDefaultPosition
}}
38 Constructor, taking an array of wxString choices and optional client data.
40 \wxheading{Parameters
}
42 \docparam{parent
}{Parent window.
}
44 \docparam{message
}{Message to show on the dialog.
}
46 \docparam{caption
}{The dialog caption.
}
48 \docparam{n
}{The number of choices.
}
50 \docparam{choices
}{An array of strings, or a string list, containing the choices.
}
52 \docparam{clientData
}{An array of client data to be associated with the items.
53 See
\helpref{GetSelectionClientData
}{wxsinglechoicedialoggetselectionclientdata
}.
}
55 \docparam{style
}{A dialog style (bitlist) containing flags chosen from standard
56 dialog styles and the following:
60 \twocolitem{{\bf wxOK
}}{Show an OK button.
}
61 \twocolitem{{\bf wxCANCEL
}}{Show a Cancel button.
}
62 \twocolitem{{\bf wxCENTRE
}}{Centre the message. Not Windows.
}
64 The default value is equivalent to
{\bf wxDEFAULT
\_DIALOG\_STYLE \pipe wxRESIZE
\_BORDER \pipe wxOK
\pipe wxCANCEL
\pipe wxCENTRE
}.
67 \docparam{pos
}{Dialog position. Not Windows.
}
71 Use
\helpref{wxSingleChoiceDialog::ShowModal
}{wxsinglechoicedialogshowmodal
} to show the dialog.
73 \pythonnote{For Python the two parameters
{\tt n
} and
{\tt choices
} are collapsed
74 into a single parameter
{\tt choices
} which is expected to be a Python
77 \perlnote{In wxPerl there is just an array reference in place of
{\tt n
}
78 and
{\tt choices
}, and the client data array, if present, must have the
79 same length as the choices array.
}
81 \membersection{wxSingleChoiceDialog::GetSelection
}\label{wxsinglechoicedialoggetselection
}
83 \constfunc{int
}{GetSelection
}{\void}
85 Returns the index of selected item.
87 \membersection{wxSingleChoiceDialog::GetSelectionClientData
}\label{wxsinglechoicedialoggetselectionclientdata
}
89 \constfunc{char*
}{GetSelectionClientData
}{\void}
91 Returns the client data associated with the selection.
93 \membersection{wxSingleChoiceDialog::GetStringSelection
}\label{wxsinglechoicedialoggetstringselection
}
95 \constfunc{wxString
}{GetStringSelection
}{\void}
97 Returns the selected string.
99 \membersection{wxSingleChoiceDialog::SetSelection
}\label{wxsinglechoicedialogsetselection
}
101 \constfunc{void
}{SetSelection
}{\param{int
}{ selection
}}
103 Sets the index of the initially selected item.
105 \membersection{wxSingleChoiceDialog::ShowModal
}\label{wxsinglechoicedialogshowmodal
}
107 \func{int
}{ShowModal
}{\void}
109 Shows the dialog, returning either wxID
\_OK or wxID
\_CANCEL.