Option group
The option group shows all options at once, as radio buttons, and marks the one equal to the tag value. Clicking an option writes its value to the tag, like the WinCC Option group. Typical uses:
- a “Manual / Auto / Service” mode;
- a “Stop / Run / Reverse” direction;
- choosing a line.
Options are set as “value=text” pairs in “Options” or taken from a project text list. Values need not be consecutive: 0=Manual; 1=Auto; 5=Service. “Orientation” puts the options in a column or a row, and they share the field equally.
Writing works like the switch:
- it checks the element’s “Operator right”;
- it asks the “Confirm” question;
- it raises “Value changed” after the write.
Without a connection to the tag the circles are grey. Without the right the group is paler, and the tooltip tells why.
With many options or little space, a symbolic field with input is more convenient: it is a drop-down list.
Properties
Section titled “Properties”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 options below | |
Items |
text | 0=Ручной; 1=Автомат; 2=Сервис |
Options. “value=text” pairs separated by “;”: 0=Manual; 1=Auto; 2=Service. Used when no project list is selected |
Orientation |
Vertical, Horizontal |
Vertical |
Direction. Options in a column or in a row |
MarkColor |
#RRGGBB |
#2F6FB0 |
Selection color. Color of the selected option’s mark |
Confirm |
text | Confirmation. Question before writing; empty — no question | |
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 |
Top |
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 | 0 |
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 |
From scripts
Section titled “From scripts”Item.Type = OptionGroup. Any property is read and changed by name: Item.MarkColor = "#D32F2F". The common element members (Visible, Enabled, Value, Raise, Apply…) are described in Elements from scripts.
Actions of this element:
| Member | Description |
|---|---|
ValueText |
Text of the selected option |
Choices() |
Options — Value and Text |
Choose(text or value) |
Choose an option, like an operator’s click |
Events
Section titled “Events”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.
Examples
Section titled “Examples”Mode from a script, for example from an “All to auto” button.
Screen.Items("Mode").Choose("Auto");What is selected now.
var m = Screen.Items("Mode");HMI.ShowMessage("Mode: " + m.ValueText);