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