]> git.saurik.com Git - wxWidgets.git/blame - docs/latex/wx/sngchdlg.tex
changed the catalogs lookup back to the old behaviour of searching LC_MESSAGES subdir...
[wxWidgets.git] / docs / latex / wx / sngchdlg.tex
CommitLineData
a660d684
KB
1\section{\class{wxSingleChoiceDialog}}\label{wxsinglechoicedialog}
2
b70b68a9
VS
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.
a660d684
KB
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
b70b68a9
VS
20\helpref{wxSingleChoiceDialog overview}{wxsinglechoicedialogoverview},
21\helpref{wxMultiChoiceDialog}{wxmultichoicedialog}
a660d684
KB
22
23\latexignore{\rtfignore{\wxheading{Members}}}
24
08f1d438 25\membersection{wxSingleChoiceDialog::wxSingleChoiceDialog}\label{wxsinglechoicedialogctor}
a660d684
KB
26
27\func{}{wxSingleChoiceDialog}{\param{wxWindow* }{parent}, \param{const wxString\& }{message},\rtfsp
eaaa6a06 28\param{const wxString\& }{caption}, \param{int }{n}, \param{const wxString* }{choices},\rtfsp
b70b68a9 29\param{void**}{ clientData = NULL}, \param{long }{style = wxCHOICEDLG\_STYLE},\rtfsp
a660d684
KB
30\param{const wxPoint\& }{pos = wxDefaultPosition}}
31
b70b68a9
VS
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}}
a660d684 36
b70b68a9 37Constructor, taking an array of wxString choices and optional client data.
a660d684
KB
38
39\wxheading{Parameters}
40
41\docparam{parent}{Parent window.}
42
43\docparam{message}{Message to show on the dialog.}
44
45\docparam{caption}{The dialog caption.}
46
47\docparam{n}{The number of choices.}
48
49\docparam{choices}{An array of strings, or a string list, containing the choices.}
50
b70b68a9
VS
51\docparam{clientData}{An array of client data to be associated with the items.
52See \helpref{GetSelectionClientData}{wxsinglechoicedialoggetselectionclientdata}.}
53
54\docparam{style}{A dialog style (bitlist) containing flags chosen from standard
55dialog styles and the following:
a660d684
KB
56
57\twocolwidtha{5cm}
58\begin{twocollist}
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.}
62\end{twocollist}
b70b68a9 63The default value is equivalent to {\bf wxDEFAULT\_DIALOG\_STYLE \pipe wxRESIZE\_BORDER \pipe wxOK \pipe wxCANCEL \pipe wxCENTRE}.
a660d684
KB
64}
65
66\docparam{pos}{Dialog position. Not Windows.}
67
68\wxheading{Remarks}
69
70Use \helpref{wxSingleChoiceDialog::ShowModal}{wxsinglechoicedialogshowmodal} to show the dialog.
71
2edb0bde 72\pythonnote{For Python the two parameters {\tt n} and {\tt choices} are collapsed
8771a323 73into a single parameter {\tt choices} which is expected to be a Python
3e02f5ed 74list of strings.}
a660d684 75
f3539882
VZ
76\perlnote{In wxPerl there is just an array reference in place of {\tt n}
77and {\tt choices}, and the client data array, if present, must have the
78same length as the choices array.}
79
08f1d438 80\membersection{wxSingleChoiceDialog::GetSelection}\label{wxsinglechoicedialoggetselection}
a660d684
KB
81
82\constfunc{int}{GetSelection}{\void}
83
84Returns the index of selected item.
85
b70b68a9 86\membersection{wxSingleChoiceDialog::GetSelectionClientData}\label{wxsinglechoicedialoggetselectionclientdata}
a660d684
KB
87
88\constfunc{char*}{GetSelectionClientData}{\void}
89
90Returns the client data associated with the selection.
91
08f1d438 92\membersection{wxSingleChoiceDialog::GetStringSelection}\label{wxsinglechoicedialoggetstringselection}
a660d684
KB
93
94\constfunc{wxString}{GetStringSelection}{\void}
95
96Returns the selected string.
97
08f1d438 98\membersection{wxSingleChoiceDialog::SetSelection}\label{wxsinglechoicedialogsetselection}
44178d92
VZ
99
100\constfunc{void}{SetSelection}{\param{int}{ selection}}
101
102Sets the index of the initially selected item.
103
a660d684
KB
104\membersection{wxSingleChoiceDialog::ShowModal}\label{wxsinglechoicedialogshowmodal}
105
106\func{int}{ShowModal}{\void}
107
108Shows the dialog, returning either wxID\_OK or wxID\_CANCEL.
109