Legato
Legato

GoFiler Legato Script Reference

 

Legato v 1.4j

Application v 5.22b

  

 

Chapter FiveGeneral Functions (continued)

5.17 Progress Display

5.17.1 Overview

Legato provides for a progress display using a variety of modeless dialog boxes. The progress display is shared with all processes and functions within the application, so only one progress window can be open at any given time. Examples of progress display dialog (window): 

Small:

Medium (Standard):

Large:

Each progress dialog has a caption, two status lines, a progress bar and an optional Cancel button (the small style does not have a visible Cancel button).

The appearance of the progress dialog will vary depending on the Windows version and the selected display theme.

If a frame window is not open and the Application Program Interface (API) is being used, the progress information can be written to the API results file.

If a progress dialog is opened by a script, it will belong to that script until closed. Use caution on leaving the progress dialog open during prolonged operations with script supporting a hook that may remain in memory for extended periods of time. Further, a crashed script can leave the progress dialog open on the screen. It is possible to run a short script that simply closes the progress using the ProgressClose function.

If the application progress dialog is open, the script’s progress functions are ignored.

5.17.2 Progress Operation

Generally a script (or any operation within the application) will display a progress window any time an operation is expected to take a long time. Many studies have shown that users expect some sort of feedback within 5 seconds of invoking an operation.

Using the delay option, any operation that may take an extended period of time, even if the time interval is not known, can display a progress dialog. If the process completes prior to the delay expiration, the dialog is not shown.

The ProgressUpdate function is used to tickle the progress, allow the screen to update, and to accept a cancel. There is little penalty to calling the update since it will only update and paint if the percentage changes. The return value of the update can be monitored for an ERROR_CANCEL code to give the user an opportunity to cancel an operation. The cancel is returned only once.

To aid in flexibility, scripts can set phases for the processing. For example, say a process occurs in five sections, five phases can be set and the progress update for each phase can be from 0-100% (or calculated as a percentage) and then the progress functions will automatically scale to the appropriate phase. This relieves the script code from having to figure out where to place the progress in context of other processes.

5.17.3 Progress Options

Aside from the progress dialog style (as shown above), there are a number of options that can be selected when the progress is opened.

By default, the progress will delay display 500ms (1/2 sec). This avoids flickering of a progress window and yet provides feedback to the user on a timely basis. The status messages can be set while the progress is hidden and will be displayed after the delay has expired.

If enabled, a progress display can have a ‘Cancel’ button. The Esc key will also cancel, however it is an asynchronous test and the key must be held for at least 250ms.

By default, the progress update will yield control of the application primary process thread and accept messages with every call. This provides for a smoother running application, however, the yield can be disabled.

5.17.4 Progress Functions