<< Click to Display Table of Contents >>
XControl |
1.In Organizer, right-click the Objects Library - XControls item and select the Insert XControl in - <New Library> option.
Inserting an XControl
2.Name this library as "TrainingLibrary".
3.Select the XControl1 object automatically created and change its Name property to "Tank".
Changing the Name property
4.On the Design tab, draw all objects on the next figure, Scale, Rectangle, and two Displays.
Design tab
NOTE |
To change a Display format, please check the Display exercise on chapter Screen and Screen Objects. |
5.To receive any external value, users must create Properties. Select the Properties tab, at the bottom of this Screen.
6.Create a Property called "Temperature" and another one called "Level", both with a Double-type.
Properties tab
7.Return to Design tab. On temperature's Display, create a Simple Link between the Temperature Property and the Value property. To do so, select the Display object, open the Properties Window and select the Links tab. In the Value property, click to open AppBrowser.
8.In AppBrowser, select the XControl Tank on the left and on the right the Temperature Property created previously. Check if in the help field appears the text typed on the Help text column when this Property was created. Click Paste.
AppBrowser
10.To change its color according to the value of a temperature, create a Table Link in the ForegroundColor property, informing limits and colors. On the Source column, select the Temperature Property created previously.
ForegroundColor property
11.On the level Display, create an Analog Link between the Level Property and the Value property.
Value property
12.In the Rectangle object, create a Simple Link between the Level and VerticalPercentFill properties.
13.To use this new object, users must register it. Save all changes, right-click the Objects Library item in Organizer, and select the Register Loaded Libraries option.
Register Loaded Libraries option