dialog(message, [title], [buttons], [icon], [window])
Description:
Shows a custom dialog window that allows the user to respond by clicking one of provided buttons.
Parameters:
| Name | Type | Default | Description |
|---|---|---|---|
|
|
string |
String message to user. It can be plain text or HTML. |
|
|
|
string |
"" |
Dialog window title shown in the title bar of the window |
|
|
string |
"OK|Cancel" |
A string of button names separated by "|" character. Indicate which button should be selected by default by surrounding the button with square brackets like so: "OK|[Cancel]" |
|
|
MessageIcon | string |
null |
One of MessageIcon icons, or an absolute path to an image from a file system. |
|
|
null |
Owner window that will be overlaid by this dialog window. |
Returns:
Returns a string of the clicked button, or null if the dialog window is closed without clicking on one of provided buttons.
Type: string | undefined
Examples:
let response = dialog("Are you ready?", "Confirm readiness", "Yes|No|[Maybe]", MessageIcon.Question, this);
if(response !== "Yes") return; // do not continue
let response = dialog("Is this you?", "Question #5", "Yes|[No]", "C://User/John/profile_icon.jpg", this);
