Show / Hide Table of Contents

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, string text2 = null, DFlags flags = 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
list  (Strings)

List items (buttons). Can be like "One|Two|Three" or new("One", "Two", "Three") or string array or List. See dialog.SetButtons.

text1  (string)

Main instruction. Bigger font.

text2  (string)

Text below main instruction.

flags  (DFlags)
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 (1-based index) of button that responds to the Enter key.

x  (Coord)

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

y  (Coord)

Y position in dialog.Screen. If default - screen 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>)

Enables hyperlinks in small-font text. A link-clicked event handler function, like with dialog.show.

Returns
int

1-based index of the selected button. Returns 0 if clicked the X (close window) button or pressed Esc.

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 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);

See Also

popupMenu.showSimple