Skip to content

Symbolic field

The symbolic field shows text instead of a number: 0 — “Manual”, 1 — “Auto”, 2 — “Service”. The texts come from a project text list or are set right in the element as “value=text” pairs. With “Input” on, the operator picks a text from the list and the number is written to the tag. “Colors by value” paints the background by thresholds.

A project text list is translated with the project and shared by all screens, so it is handier for recurring modes.

Besides the properties of every element — name, position, size, tooltip, rotation, transparency and the operate right:

Property Values Default Description
Tag tag name Tag
TextList text list Text list. Project text list; empty — the texts below
Items text 0=Выкл; 1=Вкл Texts. “value=text” pairs separated by “;”: 0=Manual; 1=Auto; 2=Service. Used when no project list is selected
Writable true / false false Input. The operator chooses a value from the list
BackgroundRules text Colors by value. Background by value: “threshold:colour” pairs separated by “;”, for example 0:#F2F3F4; 50:#F9C800; 80:#D32F2F. The colour of the highest threshold not above the value is used; below all thresholds the normal colour applies
FontFamily text Font. Windows font name: Segoe UI, Arial, Consolas, Tahoma; empty — default
FontSize number 14 Font size
Bold true / false false Bold
Italic true / false false Italic
Underline true / false false Underlined
Foreground #RRGGBB Text color. Empty — default
Alignment Left, Center, Right Left Alignment
VerticalAlignment Top, Center, Bottom Center Vertically
Background #RRGGBB Background. Empty — default
BackgroundStyle Solid, VerticalGradient, HorizontalGradient, Transparent Solid Background fill. Solid, gradient (3D) or transparent
Background2 #RRGGBB Second background color. For gradient; empty — lighter than background
BorderColor #RRGGBB Border color. Empty — default
BorderWidth number 1 Border width. 0 — no border
BorderStyle Solid, Dash, Dot, DashDot Solid Border style
CornerRadius number 0 Corner radius
Padding number Padding. From border to text; empty — default
Shadow true / false false Shadow
FlashBackground true / false false Flash background. Background alternates with the flash color; to switch by tag — use property animation
FlashBackgroundColor #RRGGBB #D32F2F Background flash color
FlashForeground true / false false Flash text
FlashForegroundColor #RRGGBB #FFFFFF Text flash color
FlashRate Slow, Medium, Fast Medium Flash rate

Item.Type = Symbolic. Any property is read and changed by name: Item.Foreground = "#D32F2F". The common element members (Visible, Enabled, Value, Raise, Apply…) are described in Elements from scripts.

Actions of this element:

Member Description
ValueText Text for the current value
Choices() Choices — Value and Text
Choose(text or value) Pick a choice as the operator does from the list

Mouse, hover, focus and keyboard — as for any element (see Events and functions). Its own events:

  • Value change (Change) — The operator entered a new value.

An “Auto” button selects the mode the same way the operator does from the list: with the right and confirmation.

Screen.Items("Mode").Choose("Auto");

The mode text in a message.

var mode = Screen.Items("Mode");
HMI.ShowMessage("The pump is in \"" + mode.ValueText + "\" mode");

The list choices for your own menu.

var names = Screen.Items("Mode").Choices().map(function (c) { return c.Value + " — " + c.Text; });
HMI.ShowMessage(names.join("\n"));