Show TOC Welcome to the QLIB 1.0 Online Reference
QLIB 

QProgress


Extends:QControl
Requires:
<script language="JavaScript" src="js/qlib/control.js"></script>
<script language="JavaScript" src="js/qlib/imagelist.js"></script>
<script language="JavaScript" src="js/qlib/progress.js"></script>
Show Demo

Description

QLIB includes an arbitrary-direction progress bar control. The growth direction as well as bar orientation is specified in object constructor and cannot be dynamically changed. The bar is set by an integer value. If value is lower or equal the LOW bound then an empty bar is displayed. Values between LOW and HIGH bounds are displayed as a percentage of the bar. If value equals or exceeds the HIGH bound, the bar gets fully filled. The bounds can be dynamically changed in runtime.

An imagelist should be provided as a resource. It must include at least two elements. The first one is used to fill empty segments, the second one represents a highlighted segment.

See Also

QImageList, UI Controls

Constructor

QProgress(parent, name, res, sizeopt, styleopt)
Creates an arbitrary-direction progress bar control. If the bar is created as a child control, valid parent object must be specified. If the progress bar object is assigned to global variable, parent should be null. The name should be the same as the name of variable or property that has been assigned by newly created object.
Parameters
parent - Parent control (if any, null otherwise).
name - The object reference name.
res - Imagelist resource (see QImageList for details).
size - Optional. Defines number of segments in the bar. Default value is 10.
style - Optional. Specifies the bar orientation and growth direction. Default value is QProgress.NORMAL.

Properties

PropertyAccessDescription
resRRefers to the resource object used to create the bar.
valueRReturns value that is currently displayed.
lowRThe LOW value bound. Corresponds to 0%.
highRThe HIGH value bound. Corresponds to 100%.
sizeRSegments count.
styleRStores the bar orientation and growth direction.
 
Properties inherited from QControl
nameRName of the control. Serves as a direct reference to this object when evaluated.
idRAlphanumerical unique identifier of the control.
parentRReference to the parent control (if any, null otherwise).
tagR / WCan refer any value or object, tag is always passed to all event handlers as the last parameter.
windowRThis property is a reference to JavaScript window object in which the control exists.
documentRRefers to document object in which the corresponding HTML elements exist. Normally all elements of a DOM2 compatible browser are children of the top document object. If the control creates new document scope (i.e. printing tags like <IFRAME>, <LAYER>), it should assign this document to this property.

Methods

set(value)
Sets new value to be displayed by the bar. The value gets rendered instantly.
Parameters
value - New value to display.
setBounds(low, high)
Updates the value bounds.
Parameters
low - The LOW value bound. Corresponds to 0%.
high - The HIGH value bound. Corresponds to 100%.
update()
Updates the component on the screen according to its current state.

Class Constants

ConstantDescription
QProgress.NORMALCreates a horizontal bar that grows from left to right (normal direction).
QProgress.REVERSECreates a horizontal bar that grows from right to left (reverse direction).
QProgress.RISECreates a vertical bar that rises from bottom to top.
QProgress.FALLCreates a vertical bar that falls from top to bottom.

CSS Class Selectors

CSS ClassDescriptionExample (defined in a CSS file)
TABLE.qprogressDefines style properties of a progress bar's TABLE element.TABLE.qprogress { background-color: green } /* fills bar background using green color. */
TABLE.qprogress TDDefines style of a segment.TABLE.qprogress TD { padding: 2px } /* sets 2px spacing around each segment. */