Window
From MegaZine3
| ASUL Component | |
|---|---|
| Tag name | window
|
| Extends | Box |
The window component allows the definition of an element that behaves like a window. It can have a child node which will be used as a drag handle (as the title bar in common operating systems), and button to close the window.
Contents |
[edit] Attributes
|
|
See: Box and AbstractAsulObject for inherited attributes. |
This component does not define any attributes.
[edit] Child nodes
$drag_handle$
- Type: any AbstractAsulObject
This component will be used to allow the user dragging the window around. If the user drags this component the whole window will be dragged.
$btn_close$
- Type: any AbstractAsulObject, should be a Button
This object will be used to "close" the window when clicked. In fact, the window will just be made invisible (visible = false), so it can be restored at any time. To properly destroy a window, call it's destroy() function.
[edit] Example
<window x="50" y="60" width="100" height="80" background="color(0x7f000000)"> <box name="$drag_handle$" anchors="0,0,pw-15,15" background="gradient(linear-vertical,0xCCCCCC,0x666666)"/> <button name="$btn_close$" width="15" height="15" anchors="pw-w"> <box name="$up$" anchors="2,2,pw-2,ph-2" background="color(0xAAAAAA)"/> <box name="$over$" anchors="2,2,pw-2,ph-2" background="color(0xEEEEEE)"/> <box name="$down$" anchors="4,4,pw-4,ph-4" background="color(0x999999)"/> </button> <text anchors="0,15,pw,ph" multiline="true" font="_sans" color="0xffffff" wordwrap="true" value="This is a draggable and closable window."/> </window>
| 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 |