]>
git.saurik.com Git - wxWidgets.git/blob - interface/msgdlg.h
22d7bb3406df4815e202d4129d17f988ceb89d6a
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: documentation for wxMessageDialog class
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.
20 @ref overview_wxmessagedialogoverview "wxMessageDialog overview"
22 class wxMessageDialog
: public wxDialog
26 Constructor. Use ShowModal() to show the dialog.
32 Message to show on the dialog.
38 A dialog style (bitlist) containing flags chosen from the following:
54 Show Yes and No buttons.
59 Used with wxYES_NO, makes Yes button the default - which is the default
65 Used with wxYES_NO, makes No button the default.
70 Shows an exclamation mark icon.
80 Shows an error icon - the same as wxICON_HAND.
85 Shows a question mark icon.
90 Shows an information (i) icon.
95 The message box stays on top of all other window, even those of the other
96 applications (Windows only).
99 Dialog position. Not Windows.
101 wxMessageDialog(wxWindow
* parent
, const wxString
& message
,
102 const wxString
& caption
= "Message box",
103 long style
= wxOK
| wxCANCEL
,
104 const wxPoint
& pos
= wxDefaultPosition
);
112 Sets the extended message for the dialog: this message is usually an extension
113 of the short message specified in the constructor or set with
114 SetMessage(). If it is set, the main message
115 appears highlighted -- if supported -- and this message appears beneath it in
116 normal font. On the platforms which don't support extended messages, it is
117 simply appended to the normal message with a new line separating them.
119 void SetExtendedMessage(const wxString exMsg
);
122 Sets the message shown by the dialog.
124 void SetMessage(const wxString msg
);
127 Overrides the default labels of the OK and Cancel buttons.
129 Please see the remarks in
130 SetYesNoLabels() documentation.
132 bool SetOKCancelLabels(const wxString ok
, const wxString cancel
);
135 Overrides the default label of the OK button.
137 Please see the remarks in
138 SetYesNoLabels() documentation.
140 bool SetOKLabel(const wxString ok
);
143 Overrides the default labels of the Yes, No and Cancel buttons.
145 Please see the remarks in
146 SetYesNoLabels() documentation.
148 bool SetYesNoCancelLabels(const wxString yes
, const wxString no
,
149 const wxString cancel
);
152 Overrides the default labels of the Yes and No buttons.
154 Notice that this function is not currently available on all platforms, so it
155 may return @false to indicate that the labels couldn't be changed. If it
156 returns @true (currently only under wxMac), the labels were set successfully.
157 Typically, if the function was used successfully, the main dialog message may
158 need to be changed, e.g.:
160 bool SetYesNoLabels(const wxString yes
, const wxString no
);
163 Shows the dialog, returning one of wxID_OK, wxID_CANCEL, wxID_YES, wxID_NO.
169 // ============================================================================
170 // Global functions/macros
171 // ============================================================================
174 General purpose message dialog. @e style may be a bit list of the
175 following identifiers:
180 Puts Yes and No buttons on the message box. May be combined with
186 Puts a Cancel button on the message box. May only be combined with
192 Puts an Ok button on the message box. May be combined with wxCANCEL.
197 Displays an exclamation mark symbol.
202 Displays an error symbol.
207 Displays an error symbol - the same as wxICON_HAND.
212 Displays a question mark symbol.
217 Displays an information symbol.
219 The return value is one of: wxYES, wxNO, wxCANCEL, wxOK.
224 int answer = wxMessageBox("Quit program?", "Confirm",
225 wxYES_NO | wxCANCEL, main_frame);
231 @e message may contain newline characters, in which case the
232 message will be split into separate lines, to cater for large messages.
234 int wxMessageBox(const wxString
& message
,
235 const wxString
& caption
= "Message",
237 wxWindow
* parent
= @NULL
,
238 int x
= -1, int y
= -1);