1 \section{\class{wxMessageDialog
}}\label{wxmessagedialog
}
3 This class represents a dialog that shows a single or multi-line message,
4 with a choice of OK, Yes, No and Cancel buttons.
6 \wxheading{Derived from
}
8 \helpref{wxDialog
}{wxdialog
}\\
9 \helpref{wxWindow
}{wxwindow
}\\
10 \helpref{wxEvtHandler
}{wxevthandler
}\\
11 \helpref{wxObject
}{wxobject
}
13 \wxheading{Include files
}
19 \helpref{wxMessageDialog overview
}{wxmessagedialogoverview
}
21 \latexignore{\rtfignore{\wxheading{Members
}}}
24 \membersection{wxMessageDialog::wxMessageDialog
}\label{wxmessagedialogctor
}
26 \func{}{wxMessageDialog
}{\param{wxWindow*
}{parent
},
\param{const wxString\&
}{message
},
\rtfsp
27 \param{const wxString\&
}{caption = "Message box"
},
\param{long
}{style = wxOK
\pipe wxCANCEL
},
\rtfsp
28 \param{const wxPoint\&
}{pos = wxDefaultPosition
}}
30 Constructor. Use
\helpref{wxMessageDialog::ShowModal
}{wxmessagedialogshowmodal
} to show the dialog.
32 \wxheading{Parameters
}
34 \docparam{parent
}{Parent window.
}
36 \docparam{message
}{Message to show on the dialog.
}
38 \docparam{caption
}{The dialog caption.
}
40 \docparam{style
}{A dialog style (bitlist) containing flags chosen from the following:
44 \twocolitem{{\bf wxOK
}}{Show an OK button.
}
45 \twocolitem{{\bf wxCANCEL
}}{Show a Cancel button.
}
46 \twocolitem{{\bf wxYES
\_NO}}{Show Yes and No buttons.
}
47 \twocolitem{{\bf wxYES
\_DEFAULT}}{Used with
{\bf wxYES
\_NO}, makes
{\bf Yes
} button the default - which is the default behaviour.
}
48 \twocolitem{{\bf wxNO
\_DEFAULT}}{Used with
{\bf wxYES
\_NO}, makes
{\bf No
} button the default.
}
49 \twocolitem{{\bf wxICON
\_EXCLAMATION}}{Shows an exclamation mark icon.
}
50 \twocolitem{{\bf wxICON
\_HAND}}{Shows an error icon.
}
51 \twocolitem{{\bf wxICON
\_ERROR}}{Shows an error icon - the same as wxICON
\_HAND.
}
52 \twocolitem{{\bf wxICON
\_QUESTION}}{Shows a question mark icon.
}
53 \twocolitem{{\bf wxICON
\_INFORMATION}}{Shows an information (i) icon.
}
54 \twocolitem{{\bf wxSTAY
\_ON\_TOP}}{The message box stays on top of all other window, even those of the other applications (Windows only).
}
58 \docparam{pos
}{Dialog position. Not Windows.
}
61 \membersection{wxMessageDialog::
\destruct{wxMessageDialog
}}\label{wxmessagedialogdtor
}
63 \func{}{\destruct{wxMessageDialog
}}{\void}
68 \membersection{wxMessageDialog::ShowModal
}\label{wxmessagedialogshowmodal
}
70 \func{int
}{ShowModal
}{\void}
72 Shows the dialog, returning one of wxID
\_OK, wxID
\_CANCEL, wxID
\_YES, wxID
\_NO.
75 \membersection{wxMessageDialog::SetYesNoLabels
}\label{wxmessagedialogsetyesnolabels
}
77 \func{bool
}{SetYesNoLabels
}{\param{const wxString&
}{yes
},
\param{const wxString&
}{no
}}
79 Overrides the default labels of the Yes and No buttons.
81 Notice that this function is not currently available on all platforms, so it
82 may return
\false to indicate that the labels couldn't be changed. If it
83 returns
\true (currently only under wxMac), the labels were set successfully.
84 Typically, if the function was used successfully, the main dialog message may
85 need to be changed, e.g.:
87 wxMessageDialog dlg(...);
88 if ( dlg.SetYesNoLabels(_("&Quit"), _("&Don't quit")) )
89 dlg.SetMessage(_("What do you want to do?"));
90 else // buttons have standard "Yes"/"No" values, so rephrase the question
91 dlg.SetMessage(_("Do you really want to quit?"));
95 \membersection{wxMessageDialog::SetYesNoCancelLabels
}\label{wxmessagedialogsetyesnocancellabels
}
97 \func{bool
}{SetYesNoCancelLabels
}{\param{const wxString&
}{yes
},
\param{const wxString&
}{no
},
\param{const wxString&
}{cancel
}}
99 Overrides the default labels of the Yes, No and Cancel buttons.
101 Please see the remarks in
102 \helpref{SetYesNoLabels
}{wxmessagedialogsetyesnolabels
} documentation.
105 \membersection{wxMessageDialog::SetOKLabel
}\label{wxmessagedialogsetyesoklabel
}
107 \func{bool
}{SetOKLabel
}{\param{const wxString&
}{ok
}}
109 Overrides the default label of the OK button.
111 Please see the remarks in
112 \helpref{SetYesNoLabels
}{wxmessagedialogsetyesnolabels
} documentation.
115 \membersection{wxMessageDialog::SetOKCancelLabels
}\label{wxmessagedialogsetokcancellabels
}
117 \func{bool
}{SetOKCancelLabels
}{\param{const wxString&
}{ok
},
\param{const wxString&
}{cancel
}}
119 Overrides the default labels of the OK and Cancel buttons.
121 Please see the remarks in
122 \helpref{SetYesNoLabels
}{wxmessagedialogsetyesnolabels
} documentation.
125 \membersection{wxMessageDialog::SetMessage
}\label{wxmessagedialogsetmessage
}
127 \func{void
}{SetMessage
}{\param{const wxString&
}{msg
}}
129 Sets the message shown by the dialog.
132 \membersection{wxMessageDialog::SetExtendedMessage
}\label{wxmessagedialogsetextendedmessage
}
134 \func{void
}{SetExtendedMessage
}{\param{const wxString&
}{exMsg
}}
136 Sets the extended message for the dialog: this message is usually an extension
137 of the short message specified in the constructor or set with
138 \helpref{SetMessage
}{wxmessagedialogsetmessage
}. If it is set, the main message
139 appears highlighted -- if supported -- and this message appears beneath it in
140 normal font. On the platforms which don't support extended messages, it is
141 simply appended to the normal message with a new line separating them.