Button - Calaméo Knowledge Base
Not a Calaméo member yet?
Sign up now! It's FREE!
Get the latest news on Calaméo
Follow us on Facebook
Get Calaméo updates in real-time
Follow us on Twitter

Button

From Calaméo Knowledge Base

A button is used inside a layout to trigger an action when the user click on it.

Attributes

Attribute Default Description
tooltip See the Tooltip attributes reference
Behaviors NEW See the Behaviors attribute reference
action Required. Define the click action. See the available actions
upState Required. Default aspect. Referencing a media or library graphic resource.
downState Aspect of the button when pressed. Referencing media or library graphic resource.
overState Asppect when cursor is over the button. Referencing media or library graphic resource.
disabledState Aspect when the button is disabled. Referencing media or library graphic resource.
A button element must be placed inside a layout element.
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 additionnal attributes are then available:

Attribute Default Description
orientation vertical Specifies the way the submenu items are distributed. It can be either horizontal or vertical.
spacer 0 Sets the space in pixels between the button's children. If not specified, the parent layout spacer value is used instead.
backgroundColor 0x000000 Sets the submenu's background color (hexadecimal format: 0xRRGGBB)
borderColor 0x000000 Sets the submenu's border color (hexadecimal)
borderSize 0 Sets the borsder's thickness in pixels
cornerRadius 0 Sets the border corner's roundness (in pixels, 0 being square corners)
horizontalMargin 0 Sets the margin between the side borders and the submenu's content
verticalMargin 0 Sets the margin between the top and bottom borders and the submenu's content