ToggleButton
From MegaZine3
| ASUL Component | |
|---|---|
| Tag name | togglebutton
|
| Extends | Box |
A basic toggle button, based on two Buttons. The state is automatically switched when clicked.
Contents |
Attributes
|
|
See: Box and AbstractAsulObject for inherited attributes. |
This component does not define any attributes.
Child nodes
Both child nodes are required, else this will behave like a normal button.
$btn_normal$
The button for the normal state. This must be a Button.
$btn_toggled$
The button for the toggled state. This must be a Button.
Example
<togglebutton anchors="50,50,pw-50,ph-50"> <button name="$btn_normal$" title="Normal" anchors="0,0,pw,ph" background="color(0xFF0000)"> <box name="$up$" anchors="0,0,pw,ph" background="color(0x7f000000)"/> <box name="$over$" anchors="0,0,pw,ph" background="color(0x7f999999)"/> <box name="$down$" anchors="0,0,pw,ph" background="color(0x7f666666)"/> </button> <button name="$btn_toggled$" title="Toggled" anchors="0,0,pw,ph" background="color(0x0000FF)"> <box name="$up$" anchors="0,0,pw,ph" background="color(0x7f000000)"/> <box name="$over$" anchors="0,0,pw,ph" background="color(0x7f999999)"/> <box name="$down$" anchors="0,0,pw,ph" background="color(0x7f666666)"/> </button> </togglebutton>
| 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 |