Download 2 Overview - Inductive Automation

Transcript
Appendix A. Components
261
Scripting
Events
The following event sets are fired by this component. See Component Event Handlers to learn
more.
mouse
mouseMotion
propertyChange
Scripting Functions
This component has no special scripting functions.
7.3
Display
7.3.1
Label
Description
The Label is one of the most versatile components. It can display text, images, or both. Its text can
be HTML formatted (like most components). It can even be made to respond to user interaction
through its events.
Labels are one of the most common components that you will want to add dynamic properties to. For
instance, you can put an integer dynamic property "state" on a label, and then bind the text to be
"On" when the state=1 and "Off" otherwise, using an expression binding. Bind the background color
to be red when the state is 0, and green when the state is 1 using a property binding. Now you have
a re-usable binary state indicator. While you could have used the Multi-State Indicator to achieve the
same effect, the exercise is good practice for creating custom components. You can see how the
flexibility of bindings and dynamic properties make the Label extremely versatile.
See also:
Dynamic Properties
Property Bindings
Properties
Appearance
Font
© 2011 Inductive Automation
Font of text of this component