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, DText text2 = null, Strings buttons = default, DFlags flags = 0, DIcon icon = 0, AnyWnd owner = default, DText expandedText = null, DText footer = null, string title = null, DControls controls = null, Coord x = default, Coord y = default, screen screen = default, int secondsTimeout = 0)
Parameters
text1  (string)

Heading text.

text2  (DText)

Message text. Can be string, or string with links like new("Text <a>link</a> text.", e => { print.it("link"); }).

buttons  (Strings)

List of button names or "id name". Examples: "OK|Cancel", "1 Yes|2 No", "1 &Save|2 Do&n't Save|0 Cancel", ["1 One", "2 Two"]. Can contain common buttons (named OK, Yes, No, Retry, Cancel, Close) and/or custom buttons (any other names). This first in the list button will be focused (aka default button). More info: dialog.Buttons.

flags  (DFlags)

Enum: CommandLinks, ExpandDown, Wider, XCancel, CenterOwner, CenterMouse, RawXY, MinimizeButton, Topmost, NoTopmost.

icon  (DIcon)

Enum: Warning, Error, Info, Shield, App.

owner  (AnyWnd)

Owner window. See dialog.OwnerWindow.

expandedText  (DText)

Text in expander control. Can be string, or string with links like new("Text <a>link</a> text.", e => { print.it("link"); }).

footer  (DText)

Text at the bottom of the dialog. Can be string, or string with links like new("Text <a>link</a> text.", e => { print.it("link"); }). 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.

x  (Coord)

X position in screen. Default - screen center. Examples: 10, ^10 (reverse), .5f (fraction).

y  (Coord)

Y position in screen. Default - screen center.

screen  (screen)

See dialog.InScreen. Examples: screen.ofMouse, screen.at.left().

secondsTimeout  (int)

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

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. Unlikely.

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.

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.