ProgressBar
| ASUL Component | |
|---|---|
| Tag name | progressbar
|
| Extends | Box |
This component allows the display of a simple progress bar, with an actual bar, which "fills up" from left to right, as the value increases, and a text field displaying the current progress.
Neither is necessary, i.e. no error will be thrown, but at least one should be given, else there will be no visible functionality of this element.
Contents |
Attributes
|
|
See: Box and AbstractAsulObject for inherited attributes. |
value
- Type: Number
- Default:
0
The initial value of the progress bar. This must be a number in the interval of 0 to 1 (inclusive), 0 meaning "empty" (0%), 1 meaning "full" (100%).
Child nodes
$bar$
The actual loading bar used. A mask is added to it that, depending on the value property, controls the visibility of the child with that name.
This can be any kind of object, but should be a Box element.
$text$
A textfield that will be used to display the current progress / value in percent. If this element (i.e. the progress bar) is localized, the first variable ($1) will be replaced with the current value multiplied by 100, so the displayed number will be in the range of [0, 100]. If the element is not localized any initial text will be overwritten whenever the value changes, with the current value and a '%' attached.
This must be a Text element.
Examples
<progressbar anchors="10,40,pw-10,60" background="color(0x7F000000)" value="0.65"> <box name="$bar$" anchors="2,2,pw-2,ph-2" background="color(0x000099)"/> <text name="$text$" anchors="0,0,pw,ph" align="center" font="_sans" color="0xFFFFFF"/> </progressbar>
| ASUL-related articles | |
|---|---|
| Components | Box · Button · ProgressBar · ScrollBar · ScrollPane · Text · ToggleButton · Window |
| Layouts | Horizontal Flow Layout · Vertical Flow Layout |
| ASUL Articles | ASUL Document · Editing the GUI · Layouting · ASUL scripting |