]> git.saurik.com Git - wxWidgets.git/blame - docs/latex/wx/msgdlg.tex
typo fix
[wxWidgets.git] / docs / latex / wx / msgdlg.tex
CommitLineData
a660d684
KB
1\section{\class{wxMessageDialog}}\label{wxmessagedialog}
2
3This class represents a dialog that shows a single or multi-line message,
4with a choice of OK, Yes, No and Cancel buttons.
5
6\wxheading{Derived from}
7
8\helpref{wxDialog}{wxdialog}\\
9\helpref{wxWindow}{wxwindow}\\
10\helpref{wxEvtHandler}{wxevthandler}\\
11\helpref{wxObject}{wxobject}
12
954b8ae6
JS
13\wxheading{Include files}
14
15<wx/msgdlg.h>
16
a7af285d
VZ
17\wxheading{Library}
18
19\helpref{wxCore}{librarieslist}
20
a660d684
KB
21\wxheading{See also}
22
23\helpref{wxMessageDialog overview}{wxmessagedialogoverview}
24
25\latexignore{\rtfignore{\wxheading{Members}}}
26
2afb9e16 27
dcbd177f 28\membersection{wxMessageDialog::wxMessageDialog}\label{wxmessagedialogctor}
a660d684
KB
29
30\func{}{wxMessageDialog}{\param{wxWindow* }{parent}, \param{const wxString\& }{message},\rtfsp
dc0cecbc 31\param{const wxString\& }{caption = "Message box"}, \param{long }{style = wxOK \pipe wxCANCEL},\rtfsp
a660d684
KB
32\param{const wxPoint\& }{pos = wxDefaultPosition}}
33
34Constructor. Use \helpref{wxMessageDialog::ShowModal}{wxmessagedialogshowmodal} to show the dialog.
35
36\wxheading{Parameters}
37
38\docparam{parent}{Parent window.}
39
40\docparam{message}{Message to show on the dialog.}
41
42\docparam{caption}{The dialog caption.}
43
44\docparam{style}{A dialog style (bitlist) containing flags chosen from the following:
45
46\twocolwidtha{5cm}
47\begin{twocollist}
48\twocolitem{{\bf wxOK}}{Show an OK button.}
49\twocolitem{{\bf wxCANCEL}}{Show a Cancel button.}
50\twocolitem{{\bf wxYES\_NO}}{Show Yes and No buttons.}
f6bcfd97
BP
51\twocolitem{{\bf wxYES\_DEFAULT}}{Used with {\bf wxYES\_NO}, makes {\bf Yes} button the default - which is the default behaviour.}
52\twocolitem{{\bf wxNO\_DEFAULT}}{Used with {\bf wxYES\_NO}, makes {\bf No} button the default.}
330d6fd0 53\twocolitem{{\bf wxICON\_EXCLAMATION}}{Shows an exclamation mark icon.}
6a611b39
JS
54\twocolitem{{\bf wxICON\_HAND}}{Shows an error icon.}
55\twocolitem{{\bf wxICON\_ERROR}}{Shows an error icon - the same as wxICON\_HAND.}
330d6fd0
RR
56\twocolitem{{\bf wxICON\_QUESTION}}{Shows a question mark icon.}
57\twocolitem{{\bf wxICON\_INFORMATION}}{Shows an information (i) icon.}
a7fd7c78 58\twocolitem{{\bf wxSTAY\_ON\_TOP}}{The message box stays on top of all other window, even those of the other applications (Windows only).}
a660d684
KB
59\end{twocollist}
60}
61
62\docparam{pos}{Dialog position. Not Windows.}
63
2afb9e16 64
dcbd177f 65\membersection{wxMessageDialog::\destruct{wxMessageDialog}}\label{wxmessagedialogdtor}
a660d684
KB
66
67\func{}{\destruct{wxMessageDialog}}{\void}
68
69Destructor.
70
2afb9e16 71
a660d684
KB
72\membersection{wxMessageDialog::ShowModal}\label{wxmessagedialogshowmodal}
73
74\func{int}{ShowModal}{\void}
75
76Shows the dialog, returning one of wxID\_OK, wxID\_CANCEL, wxID\_YES, wxID\_NO.
77
2afb9e16
VZ
78
79\membersection{wxMessageDialog::SetYesNoLabels}\label{wxmessagedialogsetyesnolabels}
80
81\func{bool}{SetYesNoLabels}{\param{const wxString&}{yes},\param{const wxString&}{no}}
82
83Overrides the default labels of the Yes and No buttons.
84
85Notice that this function is not currently available on all platforms, so it
86may return \false to indicate that the labels couldn't be changed. If it
87returns \true (currently only under wxMac), the labels were set successfully.
88Typically, if the function was used successfully, the main dialog message may
89need to be changed, e.g.:
90\begin{verbatim}
91 wxMessageDialog dlg(...);
92 if ( dlg.SetYesNoLabels(_("&Quit"), _("&Don't quit")) )
93 dlg.SetMessage(_("What do you want to do?"));
94 else // buttons have standard "Yes"/"No" values, so rephrase the question
95 dlg.SetMessage(_("Do you really want to quit?"));
96\end{verbatim}
97
98
99\membersection{wxMessageDialog::SetYesNoCancelLabels}\label{wxmessagedialogsetyesnocancellabels}
100
101\func{bool}{SetYesNoCancelLabels}{\param{const wxString&}{yes},\param{const wxString&}{no},\param{const wxString&}{cancel}}
102
103Overrides the default labels of the Yes, No and Cancel buttons.
104
105Please see the remarks in
106\helpref{SetYesNoLabels}{wxmessagedialogsetyesnolabels} documentation.
107
108
109\membersection{wxMessageDialog::SetOKLabel}\label{wxmessagedialogsetyesoklabel}
110
111\func{bool}{SetOKLabel}{\param{const wxString&}{ok}}
112
113Overrides the default label of the OK button.
114
115Please see the remarks in
116\helpref{SetYesNoLabels}{wxmessagedialogsetyesnolabels} documentation.
117
118
119\membersection{wxMessageDialog::SetOKCancelLabels}\label{wxmessagedialogsetokcancellabels}
120
121\func{bool}{SetOKCancelLabels}{\param{const wxString&}{ok},\param{const wxString&}{cancel}}
122
123Overrides the default labels of the OK and Cancel buttons.
124
125Please see the remarks in
126\helpref{SetYesNoLabels}{wxmessagedialogsetyesnolabels} documentation.
127
128
129\membersection{wxMessageDialog::SetMessage}\label{wxmessagedialogsetmessage}
130
131\func{void}{SetMessage}{\param{const wxString&}{msg}}
132
133Sets the message shown by the dialog.
134
135
136\membersection{wxMessageDialog::SetExtendedMessage}\label{wxmessagedialogsetextendedmessage}
137
d9605e63 138\func{void}{SetExtendedMessage}{\param{const wxString&}{exMsg}}
2afb9e16
VZ
139
140Sets the extended message for the dialog: this message is usually an extension
141of the short message specified in the constructor or set with
142\helpref{SetMessage}{wxmessagedialogsetmessage}. If it is set, the main message
143appears highlighted -- if supported -- and this message appears beneath it in
144normal font. On the platforms which don't support extended messages, it is
145simply appended to the normal message with a new line separating them.
146