]> git.saurik.com Git - wxWidgets.git/blame - docs/latex/wx/sngchdlg.tex
Corrected some spacing and typo errors.
[wxWidgets.git] / docs / latex / wx / sngchdlg.tex
CommitLineData
a660d684
KB
1\section{\class{wxSingleChoiceDialog}}\label{wxsinglechoicedialog}
2
3This class represents a dialog that shows a list of strings, and allows
4the user to select one. Double-clicking on a list item is equivalent to single-clicking
5and then pressing OK.
6
7\wxheading{Derived from}
8
9\helpref{wxDialog}{wxdialog}\\
10\helpref{wxWindow}{wxwindow}\\
11\helpref{wxEvtHandler}{wxevthandler}\\
12\helpref{wxObject}{wxobject}
13
954b8ae6
JS
14\wxheading{Include files}
15
16<wx/choicdlg.h>
17
a660d684
KB
18\wxheading{See also}
19
20\helpref{wxSingleChoiceDialog overview}{wxsinglechoicedialogoverview}
21
22\latexignore{\rtfignore{\wxheading{Members}}}
23
24\membersection{wxSingleChoiceDialog::wxSingleChoiceDialog}\label{wxsinglechoicedialogconstr}
25
26\func{}{wxSingleChoiceDialog}{\param{wxWindow* }{parent}, \param{const wxString\& }{message},\rtfsp
eaaa6a06 27\param{const wxString\& }{caption}, \param{int }{n}, \param{const wxString* }{choices},\rtfsp
44178d92 28\param{void**}{ clientData = NULL}, \param{long }{style = wxOK \pipe wxCANCEL \pipe wxCENTRE},\rtfsp
a660d684
KB
29\param{const wxPoint\& }{pos = wxDefaultPosition}}
30
31Constructor, taking an array of wxString choices and optional client data.
32
feaca34f
JS
33%\func{}{wxSingleChoiceDialog}{\param{wxWindow* }{parent}, \param{const wxString\& }{message},\rtfsp
34%\param{const wxString\& }{caption}, \param{const wxStringList\& }{choices},\rtfsp
35%\param{void**}{ clientData = NULL}, \param{long }{style = wxOK \pipe wxCANCEL \pipe wxCENTRE},\rtfsp
36%\param{const wxPoint\& }{pos = wxDefaultPosition}}
37%
38%Constructor, taking a string list and optional client data.
a660d684
KB
39
40\wxheading{Parameters}
41
42\docparam{parent}{Parent window.}
43
44\docparam{message}{Message to show on the dialog.}
45
46\docparam{caption}{The dialog caption.}
47
48\docparam{n}{The number of choices.}
49
50\docparam{choices}{An array of strings, or a string list, containing the choices.}
51
52\docparam{style}{A dialog style (bitlist) containing flags chosen from the following:
53
54\twocolwidtha{5cm}
55\begin{twocollist}
56\twocolitem{{\bf wxOK}}{Show an OK button.}
57\twocolitem{{\bf wxCANCEL}}{Show a Cancel button.}
58\twocolitem{{\bf wxCENTRE}}{Centre the message. Not Windows.}
59\end{twocollist}
60}
61
62\docparam{pos}{Dialog position. Not Windows.}
63
64\wxheading{Remarks}
65
66Use \helpref{wxSingleChoiceDialog::ShowModal}{wxsinglechoicedialogshowmodal} to show the dialog.
67
2edb0bde 68\pythonnote{For Python the two parameters {\tt n} and {\tt choices} are collapsed
8771a323 69into a single parameter {\tt choices} which is expected to be a Python
3e02f5ed 70list of strings.}
a660d684 71
f3539882
VZ
72\perlnote{In wxPerl there is just an array reference in place of {\tt n}
73and {\tt choices}, and the client data array, if present, must have the
74same length as the choices array.}
75
a660d684
KB
76\membersection{wxSingleChoiceDialog::\destruct{wxSingleChoiceDialog}}
77
78\func{}{\destruct{wxSingleChoiceDialog}}{\void}
79
80Destructor.
81
82\membersection{wxSingleChoiceDialog::GetSelection}
83
84\constfunc{int}{GetSelection}{\void}
85
86Returns the index of selected item.
87
88\membersection{wxSingleChoiceDialog::GetSelectionClientData}
89
90\constfunc{char*}{GetSelectionClientData}{\void}
91
92Returns the client data associated with the selection.
93
94\membersection{wxSingleChoiceDialog::GetStringSelection}
95
96\constfunc{wxString}{GetStringSelection}{\void}
97
98Returns the selected string.
99
44178d92
VZ
100\membersection{wxSingleChoiceDialog::SetSelection}
101
102\constfunc{void}{SetSelection}{\param{int}{ selection}}
103
104Sets the index of the initially selected item.
105
a660d684
KB
106\membersection{wxSingleChoiceDialog::ShowModal}\label{wxsinglechoicedialogshowmodal}
107
108\func{int}{ShowModal}{\void}
109
110Shows the dialog, returning either wxID\_OK or wxID\_CANCEL.
111