Show / Hide Table of Contents

Method dialog.showNoWait


Overload

Shows dialog like dialog.show but does not wait. Creates dialog in other thread and returns without waiting until it is closed.

public static dialog showNoWait(string text1 = null, string text2 = null, Strings buttons = default, DFlags flags = 0, DIcon icon = 0, AnyWnd owner = default, string expandedText = null, string footer = null, string title = null, DControls controls = null, int defaultButton = 0, Coord x = default, Coord y = default, screen screen = default, int secondsTimeout = 0, Action<DEventArgs> onLinkClick = null)
Parameters
text1  (string)

Main instruction. Bigger font.

text2  (string)

Text below main instruction.

buttons  (Strings)

Button ids and labels. Examples: "OK|Cancel", "1 &Save|2 Do&n't Save|0 Cancel". If omitted, null or "", the dialog will have OK button, id 1. Common buttons: OK, Yes, No, Retry, Cancel, Close. More info in Remarks.

flags  (DFlags)
icon  (DIcon)
owner  (AnyWnd)

Owner window. See dialog.SetOwnerWindow.

expandedText  (string)

Text that the user can show and hide.

footer  (string)

Text at the bottom of the dialog. Icon can be specified like "i|Text", where i is: x error, ! warning, i info, v shield, a app.

title  (string)

Title bar text. If omitted, null or "", uses dialog.options.defaultTitle.

controls  (DControls)

Can be used to add more controls and later get their values: checkbox, radio buttons, text input.

defaultButton  (int)

id of button that responds to the Enter key.

x  (Coord)

X position in dialog.Screen. If default - center. Examples: 10, ^10 (reverse), .5f (fraction).

y  (Coord)

Y position in dialog.Screen. If default - center.

screen  (screen)

dialog.Screen. Examples: screen.ofMouse, screen.index(1).

secondsTimeout  (int)

If not 0, after this time (seconds) auto-close the dialog and return dialog.Timeout.

onLinkClick  (Action<DEventArgs>)

A link-clicked event handler function, eg lambda. Enables hyperlinks in small-font text. Example:

dialog.show("", "Text <a href=\"example\">link</a>.", onLinkClick: e => { print.it(e.LinkHref); });
Returns
dialog

Variable that can be used to communicate with the dialog using these methods and properties: dialog.IsOpen, dialog.ThreadWaitForClosed, dialog.Result (when closed), dialog.Controls (when closed), dialog.DialogWindow, dialog.Send; through the Send property you can modify controls and close the dialog (see example).

Exceptions
Win32Exception

Failed to show dialog.

Remarks

This function allows you to use most of the dialog features, but not all. Alternatively you can create a dialog class instance, set properties and call dialog.ShowDialogNoWait.

More info: dialog.show.

Examples

dialog.showNoWait("Simple example");

var d = dialog.showNoWait("Another example", "text", "1 OK|2 Cancel", y: -1, secondsTimeout: 30);
2.s(); //do something while the dialog is open
d.Send.ChangeText2("new text", false);
2.s(); //do something while the dialog is open
d.ThreadWaitForClosed(); print.it(d.Result); //wait until the dialog is closed and get result. Optional, just an example.