Method dialog.showList
Overload
Shows dialog with a list of command-link buttons, and returns 1-based button index or 0.
public static int showList(Strings list, string text1 = null, DText text2 = null, DFlags flags = 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
|
list (Strings)
List items (buttons). Can be like |
|
text1 (string)
Heading text. |
|
text2 (DText)
Message text. |
|
flags (DFlags)
Enum: CommandLinks, ExpandDown, Wider, XCancel, CenterOwner, CenterMouse, RawXY, MinimizeButton, Topmost, NoTopmost. |
|
owner (AnyWnd)
Owner window. See dialog.OwnerWindow. |
|
expandedText (DText)
Text in expander control. |
|
footer (DText)
Text at the bottom of the dialog. Icon can be specified 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
1-based index of the selected button. Returns 0 if clicked the X (close window) button or pressed |
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.ShowDialog. Example in dialog class help.
Examples
int r = dialog.showList("One|Two|Three", "Example", y: -1, secondsTimeout: 15);
if(r <= 0) return; //X/Esc or timeout
print.it(r);