Legato
Legato

GoFiler Legato Script Reference

 

Legato v 1.5b

Application v 5.24b

  

 

Chapter NineDialog Functions (continued)

9.21 Progress Control

9.21.1 Introduction

This section covers the Window progress bar, or progress control. Critical parts of the Windows API has been exposed through Legato. The following text is modified from MSDN.

A progress control is a window that an application can use to indicate the progress of a lengthy operation. It consists of a rectangle that is animated as an operation progresses. The following illustration shows a progress bar that does not use visual styles.

The following illustration shows a progress control using visual styles. The appearance of the control will vary depending on the operating system and the selected theme. For more information, see Visual Styles.

9.21.2 Range and Current Position

A progress control’s range represents the entire duration of the operation, and the current position represents the progress that the application has made toward completing the operation. The window procedure uses the range and the current position to determine the percentage of the progress bar to fill with the highlight color.

If you do not set the range values, the system sets the minimum value to 0 and the maximum value to 100. You can adjust the range to convenient integers by using the ProgressControlSetRange function.

A progress control provides several functions that to set the current position. The ProgressControlUpdate function sets the position to a given value. The ProgressControlSetDelta function advances the position by adding a specified value to the current position.

9.21.3 Progress Control Types and Styles

The Windows class name is “msctls_progress32” but Legato allows for the alias of “ProgressBar” which is easier to understand. The name is also not case sensitive.

Control styles should be combined with regular window styles.

  Constant   Description  
  PBS_MARQUEE   The progress bar does not grow in size but instead moves repeatedly along the length of the bar, indicating activity without specifying what proportion of the progress is complete.  
  PBS_VERTICAL    The progress bar displays progress status vertically, from bottom to top.  

 

Example of a progress bar control declaration:

CONTROL "", 101, "ProgressBar", WS_CHILD | WS_VISIBLE, 24, 20, 120, 10, 0

9.21.4 Progress Control Functions

Page revised 2024-10-21