Label - Basic Object
Description
The Label object is an interface widget that can be found in the Basic Objects section, this object permits the user to display texts on the graphics.
The text configured can be a simple text, the value of a tag or even an expression.
Properties and Functions
Info
- Name
- Size
- Location
- ZIndex
- Draggable
Configuration
- Angle
- Text
- Url To Open (Configure the label object to open an URL link)
- Text Font
- Text Wrapping
- Text Alignment
- Corner Radius
- Number of Decimals
- HotKey
- Is Enabled
- Is Visible
- ToolTip
Functions
- .FontColor
- .Text
The above properties and functions can be configured using the Property Window when the object is selected, but they can also be changed during runtime using a script. The script must be on the same screen as the object is located and they can be accessed by the name of the object (i.e. objName.Text= “New Label Text”; )
Inserting a Label
To create a new Label in the Graphics Document:
- Click the “Label” option in the Ribbon.
- Place the mouse pointer where you want to create the Label.
- Click to create the new Label.
Text
This property allows the user to configure the text that will be displayed in the Label object.
To configure this property, follow the steps below:
1. Click the desired label object to select it.
2. On the properties of the object, configure the “Text” field with the desired text.
Method 1. Simple Text:
In this example, we configured the text to be “ADISRA”
Method 2. Value of a tag:
In this example, we configured the text to be the value of the tag “@StringTag”
Method 3. Expression:
In this example, we configured the text to be the result of the expression “@IntTag + 10;”
,
URL To Open
This property allows the user to open a configured URL link in the machine’s default browser when the label is clicked.
To configure this property, follow the steps below:
1. Click the desired label object to select it.
2. On the properties of the object, configure the “UrlToOpen” field with the desired URL. In this example, we configure the ADISRA website
3. When the project is running, click the label object to open the configured URL.
Number of decimals
Allows configuring the number of decimals that will be visible in the Label text. Let’s say you configured the Text to show the value of a Float tag, in this case you can set the Label to show the default number of decimals which can be configured in the Ribbon -> Settings or a custom number of decimals configured for that button.
Script Events
The Label Object provides several Script Events for the user.
- Mouse Up
- Mouse Down
- Mouse While
- Mouse Right Up
- Mouse Right Down
- Mouse Double Click
Security
It is possible to configure different permissions per profile for this object. For further information, please check the Security white paper.