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>
|
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
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
| Property | Access | Description |
res | R | Refers to the resource object used to create the bar. |
value | R | Returns value that is currently displayed. |
low | R | The LOW value bound. Corresponds to 0%. |
high | R | The HIGH value bound. Corresponds to 100%. |
size | R | Segments count. |
style | R | Stores the bar orientation and growth direction. |
Properties inherited from QControl |
name | R | Name of the control. Serves as a direct reference to this object when evaluated. |
id | R | Alphanumerical unique identifier of the control. |
parent | R | Reference to the parent control (if any, null otherwise). |
tag | R / W | Can refer any value or object, tag is always passed to all event handlers as the last parameter. |
window | R | This property is a reference to JavaScript window object in which the control exists. |
document | R | Refers 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
| Constant | Description |
QProgress.NORMAL | Creates a horizontal bar that grows from left to right (normal direction). |
QProgress.REVERSE | Creates a horizontal bar that grows from right to left (reverse direction). |
QProgress.RISE | Creates a vertical bar that rises from bottom to top. |
QProgress.FALL | Creates a vertical bar that falls from top to bottom. |
CSS Class Selectors
| CSS Class | Description | Example (defined in a CSS file) |
TABLE.qprogress | Defines style properties of a progress bar's TABLE element. | TABLE.qprogress { background-color: green } /* fills bar background using green color. */ |
TABLE.qprogress TD | Defines style of a segment. | TABLE.qprogress TD { padding: 2px } /* sets 2px spacing around each segment. */ |