Method dialog.show
Overload
Shows dialog.
public static int show(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 |
|
buttons (Strings)
List of button names or |
|
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 |
|
footer (DText)
Text at the bottom of the dialog. Can be string, or string with links like |
|
title (string)
Title bar text. If omitted, |
|
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: |
|
y (Coord)
Y position in screen. Default - screen center. |
|
screen (screen)
See dialog.InScreen. Examples: |
|
secondsTimeout (int)
If not 0, after this time (seconds) auto-close the dialog and return dialog.Timeout. |
Returns
|
int
Selected button id. |
Exceptions
|
Win32Exception
Failed to show dialog. Unlikely. |
Remarks
Tip: Use named arguments. Example: dialog.show("Text", icon: DIcon.Info, title: "Title") .
This function allows you to use many dialog features, but not all. Alternatively you can create a dialog class instance, set properties and call dialog.ShowDialog. Example in dialog class help.
Examples
if(1 != dialog.show("Continue?", null, "1 OK|2 Cancel", icon: DIcon.Info)) return;
print.it("OK");
switch (dialog.show("Save changes?", "More info.", "1 Save|2 Don't Save|0 Cancel")) {
case 1: print.it("save"); break;
case 2: print.it("don't"); break;
default: print.it("cancel"); break;
}
var con = new DControls { Checkbox = "Check", RadioButtons = "1 One|2 Two|3 Three", EditType = DEdit.Combo, EditText = "zero", ComboItems = ["one", "two"] };
var r = dialog.show("Main text", "More text.", "1 OK|2 Cancel", expandedText: "Expanded text", controls: con, secondsTimeout: 30);
print.it(r, con.IsChecked, con.RadioId, con.EditText);
switch(r) {
case 1: print.it("OK"); break;
case dialog.Timeout: print.it("timeout"); break;
default: print.it("Cancel"); break;
}