PhantomScript v1.7 Reference - Copyright © 2006 P1 Systems Incorporated. All Rights Reserved.

Prev | Next | Users Guide | PhantomScript Reference | P1 Systems


Dialog Statements

ProgressBar

Syntax

ProgressBar
Value=<text>
[Width=<width>]
[Height=<height>]
[FontSize=<int>]
[FontStyle=Plain|Bold|Italic|BoldItalic]
[BackgroundColor=<rgb-list>]
[TextColor=<rgb-list>]

Description

A progress bar for showing progress of long-running actions.

Parameters

Value="<label>"

A variable or a literal value between 0 and 100 that indicates the percent complete. This determines the length of the progress bar.

Width="<width>"

Optional. The width of the control. Normally the default width is adequate. This parameter allows overriding the default width.

Height="<height>"

Optional. The height of the control. Normally the default height is adequate. This parameter allows overriding the height width.

FontSize=<int>

Optional. If present, this parameter sets the default font size for dialog items.<int> specifies the point size of the font. The default dialog font size used by Phantom for Windows is 8. This determines the size of the progress bar elements.

BackgroundColor=<rgb-list>

Optional. This parameter, if present, sets the background color for the dialog box and the default background color for dialog items. <rgb-list> is a three-item list specifying the intensity of the red, green, and blue components of the color, respectively, where intensity is an integer between 0 and 255 inclusive. For example, the color red is specified as 255,0,0.

A number of intrinsic variables are automatically declared for some of the more commonly used colors. These may be used instead of specifying the color values explicitly. The standard color variables defined are:

Red
DarkRed
Green
LightGreen
DarkGreen
Blue
DarkBlue
LightBlue
Black
White
Gray
DarkGray
LightGray
Cyan
Magenta
Orange
Pink
Yellow
In addition, the following color variables are defined. Their values depend on the current settings of the Windows environment:

DialogBackgroundColor
DesktopColor
ActiveCaptionColor
InactiveCaptionColor
WindowBackgroundColor

TextColor=<rgb-list>

Optional. This parameter, if present, sets the default text color for dialog items. See BackgroundColor above for a description of <rgb-list>

Remarks

ProgressBar controls are intended for use with non-modal dialogs so that the percent complete can be changed as the task progresses. (See the sample script fragment below for an example of this.)

ProgressBar requires the Wingdings font.

Example

          progress0 = 0 
progress1 = 0
progress2 = 0

BeginDialog Title="Progress" NonModal Result=dlg
VGroup
StaticText
Text=progress0
Width=50
ProgressBar
Value=progress2
TextColor=Blue
Width=200
FontSize=6
ProgressBar
Value=progress1
TextColor=Blue
Width=200
FontSize=10
EndDialog

For i = 1 To 2000 Loop
progress0 = (i * 100) / 2000
progress1 = progress0
progress2 = (i % 200) * 100 / 200
EndLoop
Close dlg

The above script fragment displays a static text control and two progress bars. The upper progress bar cycles 10 times as the lower bar moves from 0 to 100 percent. Note the three separate progress variables used. Each control requires its own individual progress variable. (Two controls cannot share the same controlling variable.)



Prev | Next | Users Guide | PhantomScript Reference | P1 Systems

PhantomScript v1.7 Reference - Copyright © 2006 P1 Systems Incorporated. All Rights Reserved.