MessageDialog

Pops up a dialog box with a user defined message and buttons.

Constructors

this
this(Window parent, string title)

Construct the dialog.

this
this(string title)

Construct the dialog.

Members

Functions

setDefaultButton
auto setDefaultButton(string button)

Set the default button.

setDetailMessage
auto setDetailMessage(string message)

Set the detail message. The message detail will be presented beneath the main message and, where supported by the OS, in a less emphasized font than the main message.

setIcon
auto setIcon(string icon)

Set the preset dialog icon. It must be one of the following: error, info, question or warning.

setMessage
auto setMessage(string message)

Set the main message to display in the message dialog.

setType
auto setType(string type)

Set the message dialog type. Arranges for a predefined set of buttons to be displayed.

show
auto show()

Show the dialog.

Inherited Members

From Dialog

_parent
Window _parent;
Undocumented in source.
_title
string _title;
Undocumented in source.
_results
string[] _results;
Undocumented in source.
getResult
string getResult()

Get the dialog result. This varies on the type of dialog used and will reflect the overall result expected of each dialog.

removeBracesFromResults
void removeBracesFromResults()

Remove any leading or trailing braces.

show
auto show()

Show the dialog.

Examples

auto dialog = new MessageDialog("Save file?")
	.setIcon(MessageDialogIcon.question)
	.setMessage("Do you want to save this file?")
	.setType(MessageDialogType.okcancel)
	.show();

string buttonClicked = dialog.getResult();

Result: The symbolic name of the button pressed.

See Also

Meta