<< Click to Display Table of Contents >> Navigation: Object Reference > Palette Objects > Button Object |
The button object can display two states: Pressed or released.
To change the look & feel of the button, it can be configured with its properties.
For common object properties refer to this page. Here only the button specific properties are described.
Example project: Download this project to see the different button events in action.
Two other objects can be added to a button. One indicating the released state of the button and one the pressed state. The button supports the following child object types: •Numeric Field •String Field •Arched Bargraph •Linear Bargraph •Meter •List •Picture Graphic •Container It is common to use String Fields or Picture Graphics for pressed and released objects. Containers can be used to design more complex buttons while keeping the "one object for pressed and one object for released state" constraint. Note: If only one child is assigned it will be shown permanently on device whereas toggling "Pressed State" on PC tool will show one state empty and the other with the child. Attention: While it is technically possible, do not put a container inside of a button and then another button inside the container. Such combinations are not supported or tested and will most likely lead to unexpected behavior. How to add the objects to a button:•Drop a button on a frame •Make sure that the "Pressed State" property of the button is disabled •Drag any supported object from the palette to the button in the designer area (or an existing object from project tree to the button in project tree) oThe added object will now represent the release state of the button •Enable the property "Pressed State" •Drag any supported object from the palette to the button in the designer area (or an existing object from project tree to the button in project tree) oThe added object will now represent the press state of the button To assign another object to a button, follow the same steps above. A dialog will ask if the pressed/released object shall be replaced.
Pressed / Released ImageAlternatively to putting one or two Picture Graphic objects into the button, these properties can be used to add 1 or 2 images to the button without adding more objects. |
The following events can be configured for the button object: •OnPress •OnRelease •OnLongPress •OnLongRelease •OnDblClick •OnOpenForInput •OnEnabledWithFocus •OnEnabledWithoutFocus •OnValueChange •OnCancel
See here for the descriptions of all event and possible actions that can be assigned. |