Button (Paint Object)
Paint buttons enable a model to respond to user clicks. Their key feature is multiple configurable states, each fully customisable with text, colours, fonts and images. Paint Buttons support automatic state selection when hovered and clicked as well as model driven state control, which is useful with a group of buttons.
Paint Buttons can have a number of states defined, with an [Attribute Reference]] determining which state is currently active.
States are indexed in the order that they are defined (and appear in the state menu for the button) starting at 1.
Each state has the following properties
- an ID by which the state is referenced and a name
- Graphics formatting including border style, background/gradient and text colour.
- Text the button displays, and the font to use
- Tool tip text
- Name of an image which fills the background
- Text rotation
- Alignment options (centre, left, top)
- Clickability override
- Hover response
- Image shadow and flipping
Note that changes in the control attribute do not update paint objects automatically, a ForceRepaint, RepaintPanel or RepaintPaintObject needs to be explicitly performed. This does not apply to paint objects in the Animate Layer.
Planimate will automatically select a state on hover if it has the hover state option selected.
If the Mouse Down State option is set, then instead of indenting/changing the style of the button when it is pressed, the button will switch state. This gives the modeller more flexibilty in how the button looks when the user actually clicks in it.
Paint buttons that send broadcasts also send some tuple attributes
_panel : Panel of the button (from panel label list) _paintid : Index of the paint object (from paint label list)
states and Inheritance
States can be named. The name is used when inheriting to propagate changes. States added to the parent are added to the children, states deleted from the parent are deleted from the children if they exist. States named unique to the children are left untouched.
Changes in an action or an action's properties are checked so customisations of an action are not lost if the parent is changed.
A change in a child object's action properties/options makes that child/action unique and a change to the master's action (even if it’s the same type of action) wont change any property of the customised child object.
EXCEPTION: This does not apply to inherited Dialog action buttons, they are always treated as unique and wont track the master button while it has a dialog action. HOWEVER If the master is changed from having a dialog action to another action type, ALL inherited buttons in dialog mode will be changed to the new action.