]>
git.saurik.com Git - wxWidgets.git/blob - interface/msgdlg.h
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: interface of wxMessageDialog
4 // Author: wxWidgets team
6 // Licence: wxWindows license
7 /////////////////////////////////////////////////////////////////////////////
10 @class wxMessageDialog
13 This class represents a dialog that shows a single or multi-line message,
14 with a choice of OK, Yes, No and Cancel buttons.
19 @see @ref overview_wxmessagedialogoverview "wxMessageDialog overview"
21 class wxMessageDialog
: public wxDialog
25 Constructor. Use ShowModal() to show the dialog.
30 Message to show on the dialog.
34 A dialog style (bitlist) containing flags chosen from the following:
69 Show Yes and No buttons.
80 Used with wxYES_NO, makes Yes button the default - which is the default
92 Used with wxYES_NO, makes No button the default.
103 Shows an exclamation mark icon.
125 Shows an error icon - the same as wxICON_HAND.
136 Shows a question mark icon.
147 Shows an information (i) icon.
158 The message box stays on top of all other window, even those of the other
159 applications (Windows only).
161 Dialog position. Not Windows.
163 wxMessageDialog(wxWindow
* parent
, const wxString
& message
,
164 const wxString
& caption
= "Message box",
165 long style
= wxOK
| wxCANCEL
,
166 const wxPoint
& pos
= wxDefaultPosition
);
174 Sets the extended message for the dialog: this message is usually an extension
175 of the short message specified in the constructor or set with
176 SetMessage(). If it is set, the main message
177 appears highlighted -- if supported -- and this message appears beneath it in
178 normal font. On the platforms which don't support extended messages, it is
179 simply appended to the normal message with a new line separating them.
181 void SetExtendedMessage(const wxString exMsg
);
184 Sets the message shown by the dialog.
186 void SetMessage(const wxString msg
);
189 Overrides the default labels of the OK and Cancel buttons.
190 Please see the remarks in
191 SetYesNoLabels() documentation.
193 bool SetOKCancelLabels(const wxString ok
, const wxString cancel
);
196 Overrides the default label of the OK button.
197 Please see the remarks in
198 SetYesNoLabels() documentation.
200 bool SetOKLabel(const wxString ok
);
203 Overrides the default labels of the Yes, No and Cancel buttons.
204 Please see the remarks in
205 SetYesNoLabels() documentation.
207 bool SetYesNoCancelLabels(const wxString yes
, const wxString no
,
208 const wxString cancel
);
211 Overrides the default labels of the Yes and No buttons.
212 Notice that this function is not currently available on all platforms, so it
213 may return @false to indicate that the labels couldn't be changed. If it
214 returns @true (currently only under wxMac), the labels were set successfully.
215 Typically, if the function was used successfully, the main dialog message may
216 need to be changed, e.g.:
218 bool SetYesNoLabels(const wxString yes
, const wxString no
);
221 Shows the dialog, returning one of wxID_OK, wxID_CANCEL, wxID_YES, wxID_NO.
228 // ============================================================================
229 // Global functions/macros
230 // ============================================================================
233 General purpose message dialog. @a style may be a bit list of the
234 following identifiers:
238 Puts Yes and No buttons on the message box. May be combined with
243 Puts a Cancel button on the message box. May only be combined with
248 Puts an Ok button on the message box. May be combined with wxCANCEL.
252 Displays an exclamation mark symbol.
256 Displays an error symbol.
260 Displays an error symbol - the same as wxICON_HAND.
264 Displays a question mark symbol.
268 Displays an information symbol.
270 The return value is one of: wxYES, wxNO, wxCANCEL, wxOK.
275 int answer = wxMessageBox("Quit program?", "Confirm",
276 wxYES_NO | wxCANCEL, main_frame);
282 @a message may contain newline characters, in which case the
283 message will be split into separate lines, to cater for large messages.
285 int wxMessageBox(const wxString
& message
,
286 const wxString
& caption
= "Message",
288 wxWindow
* parent
= NULL
,
289 int x
= -1, int y
= -1);