Tabs
Tabs gather several project screens in one place. Typical uses:
- an equipment panel with “Overview / Settings / Alarms / Service”;
- plant areas;
- settings pages.
Labels switch the tabs. Each tab shows its own project screen, like a screen window, with live values, animations and events. A screen is built when its tab is opened, so closed tabs do not load the client.
Settings:
- “Tabs” holds “label=screen” pairs:
Overview=Pump1Main; Settings=Pump1Settings; Service=Pump1Service. A tab without a screen is empty. - “Open tab” is the tab number, from zero, shown when the screen opens.
- “Labels” puts the labels at the top, bottom or left.
With a “Tab tag”, the number of the open tab lives in the tag:
- the tab follows the tag, so a PLC or another screen can switch it;
- an operator’s click writes the number to the tag.
This keeps the open tab when moving between screens, and everyone watching the tag sees the same tab.
When the operator opens another tab, the “Row selected” event fires and the tab number is in Item.Selected. A script reaches elements on the open tab through the tabs: Children("Name").
Properties
Section titled “Properties”Besides the properties of every element — name, position, size, tooltip, rotation, transparency and the operate right:
| Property | Values | Default | Description |
|---|---|---|---|
Pages |
text | Обзор=; Параметры= |
Tabs. “label=screen” pairs separated by “;”: Overview=Pump1Main; Settings=Pump1Settings |
StartTab |
integer | 0 |
Open tab. Tab number when the screen opens, from zero |
Tag |
tag name | Tab tag. Number of the open tab from zero: the tab follows the tag, the operator’s choice is written to the tag | |
Placement |
Top, Bottom, Left |
Top |
Labels. Top, bottom or left |
TabSize |
number | 32 |
Label height. For labels on the left — their width |
TabColor |
#RRGGBB |
#E1E4E8 |
Label color |
ActiveColor |
#RRGGBB |
#FFFFFF |
Open tab color |
MarkColor |
#RRGGBB |
#2F6FB0 |
Marker color. Stripe at the open tab’s label |
FontFamily |
text | Font. Windows font name: Segoe UI, Arial, Consolas, Tahoma; empty — default | |
FontSize |
number | 13 |
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 |
#5C646C |
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 |
From scripts
Section titled “From scripts”Item.Type = Tabs. Any property is read and changed by name: Item.TabColor = "#D32F2F". The common element members (Visible, Enabled, Value, Raise, Apply…) are described in Elements from scripts.
Actions of this element:
| Member | Description |
|---|---|
Tabs() |
The tab labels |
Selected |
Number of the open tab from zero |
SelectedTitle |
Label of the open tab |
Select(number or label) |
Open a tab, 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:
- Row selected (
SelectionChanged) — The operator selected another row, alarm or tab; the selection is in Item.Selected.
Examples
Section titled “Examples”Open a tab from a script, for example on an equipment alarm.
Screen.Items("Panel").Select("Alarms");An element on the open tab.
var p = Screen.Items("Panel");if (p.SelectedTitle == "Settings") p.Children("Setpoint").Value = 50;“Row selected” event: show which tab the operator opened.
HMI.ShowMessage("Open tab: " + Item.SelectedTitle);