Button
A <button> is used inside a <layout> to trigger an action when the user clicks on it.
Attributes
| Attribute | Type | Default | Description |
|---|---|---|---|
| tooltip | See the Tooltip attributes reference | ||
| Behaviors | See the Behaviors attribute reference | ||
| action | STRING | Required. Define the click action. See the available actions | |
| upState | STRING | Required. Default aspect. Referencing a media or library graphic resource | |
| downState | STRING | Aspect of the button when pressed. Referencing media or library graphic resource | |
| overState | STRING | Aspect when cursor is over the button. Referencing media or library graphic resource | |
| disabledState | STRING | Aspect when the button is disabled. Referencing media or library graphic resource |
info
If a state is missing, upState is used instead.
Submenus
You can build submenus by adding other buttons as children elements and by using the submenu action.
The following additional attributes are then available:
| Attribute | Type | Default | Description |
|---|---|---|---|
| orientation | STRING | vertical | Specifies the way the submenu items are distributed. It can be either horizontal or vertical |
| spacer | INTEGER | 0 | Sets the space in pixels between the button's children. If not specified, the parent layout spacer value is used instead |
| backgroundColor | COLOR | 0x000000 | Sets the submenu's background color |
| borderColor | COLOR | 0x000000 | Sets the submenu's border color |
| borderSize | INTEGER | 0 | Sets the border's thickness in pixels |
| cornerRadius | INTEGER | 0 | Sets the border corner's roundness (in pixels, 0 being square corners) |
| horizontalMargin | INTEGER | 0 | Sets the margin between the side borders and the submenu's content |
| verticalMargin | INTEGER | 0 | Sets the margin between the top and bottom borders and the submenu's content |