Method dialog.showProgress
Overload
Shows dialog with progress bar. Creates dialog in new thread and returns without waiting until it is closed.
public static dialog showProgress(bool marquee, string text1 = null, string text2 = null, string buttons = "0 Cancel", DFlags flags = 0, AnyWnd owner = default, string expandedText = null, string footer = null, string title = null, DControls controls = null, Coord x = default, Coord y = default, screen screen = default, int secondsTimeout = 0, Action<DEventArgs> onLinkClick = null)
Parameters
marquee (bool)
Let the progress bar animate without indicating a percent of work done. |
text1 (string)
Main instruction. Bigger font. |
text2 (string)
Text below main instruction. |
buttons (string)
Button ids and labels. Examples: |
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 |
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 dialog.Screen. If default - center. Examples: |
y (Coord)
Y position in dialog.Screen. If default - center. |
screen (screen)
dialog.Screen. Examples: |
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:
|
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 set progress, 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
var pd = dialog.showProgress(false, "Working", buttons: "1 Stop", y: -1);
for(int i = 1; i <= 100; i++) {
if(!pd.IsOpen) { print.it(pd.Result); break; } //if the user closed the dialog
pd.Send.Progress(i); //don't need this if marquee
50.ms(); //do something in the loop
}
pd.Send.Close();