]> git.saurik.com Git - wxWidgets.git/blame_incremental - docs/latex/wx/sngchdlg.tex
escape underscores introduced by the last change
[wxWidgets.git] / docs / latex / wx / sngchdlg.tex
... / ...
CommitLineData
1\section{\class{wxSingleChoiceDialog}}\label{wxsinglechoicedialog}
2
3This class represents a dialog that shows a list of strings, and allows the
4user to select one. Double-clicking on a list item is equivalent to
5single-clicking and then pressing OK.
6
7\wxheading{Derived from}
8
9\helpref{wxDialog}{wxdialog}\\
10\helpref{wxTopLevelWindow}{wxtoplevelwindow}\\
11\helpref{wxWindow}{wxwindow}\\
12\helpref{wxEvtHandler}{wxevthandler}\\
13\helpref{wxObject}{wxobject}
14
15\wxheading{Include files}
16
17<wx/choicdlg.h>
18
19\wxheading{See also}
20
21\helpref{wxSingleChoiceDialog overview}{wxsinglechoicedialogoverview},
22\helpref{wxMultiChoiceDialog}{wxmultichoicedialog}
23
24\latexignore{\rtfignore{\wxheading{Members}}}
25
26\membersection{wxSingleChoiceDialog::wxSingleChoiceDialog}\label{wxsinglechoicedialogctor}
27
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}}
32
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}}
37
38Constructor, taking an array of wxString choices and optional client data.
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{clientData}{An array of client data to be associated with the items.
53See \helpref{GetSelectionClientData}{wxsinglechoicedialoggetselectionclientdata}.}
54
55\docparam{style}{A dialog style (bitlist) containing flags chosen from standard
56dialog styles and the following:
57
58\twocolwidtha{5cm}
59\begin{twocollist}
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.}
63\end{twocollist}
64The default value is equivalent to {\bf wxDEFAULT\_DIALOG\_STYLE \pipe wxRESIZE\_BORDER \pipe wxOK \pipe wxCANCEL \pipe wxCENTRE}.
65}
66
67\docparam{pos}{Dialog position. Not Windows.}
68
69\wxheading{Remarks}
70
71Use \helpref{wxSingleChoiceDialog::ShowModal}{wxsinglechoicedialogshowmodal} to show the dialog.
72
73\pythonnote{For Python the two parameters {\tt n} and {\tt choices} are collapsed
74into a single parameter {\tt choices} which is expected to be a Python
75list of strings.}
76
77\perlnote{In wxPerl there is just an array reference in place of {\tt n}
78and {\tt choices}, and the client data array, if present, must have the
79same length as the choices array.}
80
81\membersection{wxSingleChoiceDialog::GetSelection}\label{wxsinglechoicedialoggetselection}
82
83\constfunc{int}{GetSelection}{\void}
84
85Returns the index of selected item.
86
87\membersection{wxSingleChoiceDialog::GetSelectionClientData}\label{wxsinglechoicedialoggetselectionclientdata}
88
89\constfunc{char*}{GetSelectionClientData}{\void}
90
91Returns the client data associated with the selection.
92
93\membersection{wxSingleChoiceDialog::GetStringSelection}\label{wxsinglechoicedialoggetstringselection}
94
95\constfunc{wxString}{GetStringSelection}{\void}
96
97Returns the selected string.
98
99\membersection{wxSingleChoiceDialog::SetSelection}\label{wxsinglechoicedialogsetselection}
100
101\constfunc{void}{SetSelection}{\param{int}{ selection}}
102
103Sets the index of the initially selected item.
104
105\membersection{wxSingleChoiceDialog::ShowModal}\label{wxsinglechoicedialogshowmodal}
106
107\func{int}{ShowModal}{\void}
108
109Shows the dialog, returning either wxID\_OK or wxID\_CANCEL.
110