]>
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:
46 Show Yes and No buttons.
50 Used with wxYES_NO, makes Yes button the default - which is the default
55 Used with wxYES_NO, makes No button the default.
59 Shows an exclamation mark icon.
67 Shows an error icon - the same as wxICON_HAND.
71 Shows a question mark icon.
75 Shows an information (i) icon.
79 The message box stays on top of all other window, even those of the other
80 applications (Windows only).
82 Dialog position. Not Windows.
84 wxMessageDialog(wxWindow
* parent
, const wxString
& message
,
85 const wxString
& caption
= "Message box",
86 long style
= wxOK
| wxCANCEL
,
87 const wxPoint
& pos
= wxDefaultPosition
);
95 Sets the extended message for the dialog: this message is usually an extension
96 of the short message specified in the constructor or set with
97 SetMessage(). If it is set, the main message
98 appears highlighted -- if supported -- and this message appears beneath it in
99 normal font. On the platforms which don't support extended messages, it is
100 simply appended to the normal message with a new line separating them.
102 void SetExtendedMessage(const wxString exMsg
);
105 Sets the message shown by the dialog.
107 void SetMessage(const wxString msg
);
110 Overrides the default labels of the OK and Cancel buttons.
111 Please see the remarks in
112 SetYesNoLabels() documentation.
114 bool SetOKCancelLabels(const wxString ok
, const wxString cancel
);
117 Overrides the default label of the OK button.
118 Please see the remarks in
119 SetYesNoLabels() documentation.
121 bool SetOKLabel(const wxString ok
);
124 Overrides the default labels of the Yes, No and Cancel buttons.
125 Please see the remarks in
126 SetYesNoLabels() documentation.
128 bool SetYesNoCancelLabels(const wxString yes
, const wxString no
,
129 const wxString cancel
);
132 Overrides the default labels of the Yes and No buttons.
133 Notice that this function is not currently available on all platforms, so it
134 may return @false to indicate that the labels couldn't be changed. If it
135 returns @true (currently only under wxMac), the labels were set successfully.
136 Typically, if the function was used successfully, the main dialog message may
137 need to be changed, e.g.:
139 bool SetYesNoLabels(const wxString yes
, const wxString no
);
142 Shows the dialog, returning one of wxID_OK, wxID_CANCEL, wxID_YES, wxID_NO.
149 // ============================================================================
150 // Global functions/macros
151 // ============================================================================
153 /** @ingroup group_funcmacro_dialog */
157 General purpose message dialog. @c style may be a bit list of the
158 following identifiers:
162 Puts Yes and No buttons on the message box. May be combined with
165 Puts a Cancel button on the message box. May only be combined with
168 Puts an Ok button on the message box. May be combined with wxCANCEL.
169 @style{wxICON_EXCLAMATION}:
170 Displays an exclamation mark symbol.
172 Displays an error symbol.
173 @style{wxICON_ERROR}:
174 Displays an error symbol - the same as wxICON_HAND.
175 @style{wxICON_QUESTION}:
176 Displays a question mark symbol.
177 @style{wxICON_INFORMATION}:
178 Displays an information symbol.
180 The return value is one of: wxYES, wxNO, wxCANCEL, wxOK. For example:
183 int answer = wxMessageBox("Quit program?", "Confirm",
184 wxYES_NO | wxCANCEL, main_frame);
189 @a message may contain newline characters, in which case the message will
190 be split into separate lines, to cater for large messages.
194 int wxMessageBox(const wxString
& message
,
195 const wxString
& caption
= "Message",
197 wxWindow
* parent
= NULL
,
198 int x
= -1, int y
= -1);