Is there a way to change the background of a selected tab depending on an indicator?
For example, the component labeled "Servo Status" has that indicator on it that says "Servo OK".
I want to be able to do something to where if that tag, or the state of the indicator, isn't equal to one, the background color of the Servos tab on the tabStrip will change to red. How can I do this?
I'm sorry, but I'm not doing enough Vision work to help with your actual question but I think you need to study some good HMI / GUI guidelines. I'm looking at it and have the following problems:
The tab strip looks like a row of buttons. There is no visual clue that it's a tab.
The tab strip is center-aligned. This makes it look less like a tab. Align hard left or right as on any office application.
The active tab should be the same color as the page it is revealing if you wish to give a visual cue. Yours aren't.
There are two different styles of heading, "Servo Motors" and "Accumulator 1" in different styles. These further break up any hope of the page looking tabbed. The headings have wildly contrasting styles.
Inconsistent use of italics. Why use it at all? What GUI standard uses it? Similar inconsistent use of boldface.
Numbers center-aligned in numeric fields. Decimals now don't align. Numbers should generally be right aligned.
"Reset Torque" is blue. The text looks like it might be that of a button but the component doesn't look like a button. Maybe if every other button is blue the user might get used to it but on first glance it's not obvious.
Non-alignment of items: Servo Status seems unnecessarily wide as does Reset Torque. They could be narrowed, made the same width and the three labels below left aligned with the edge of the components above. The numeric value fields could then be right-aligned with the components above. The result would be much more pleasing to the eye.
What does white and gray signify on the numeric and text fields? I would expect the background color to give a clue as to whether or not the field is editable but I doubt that any are.
Why is "Faults" in a purple frame when Fault Lookup and the torque readings aren't?
The overall result makes it very difficult to establish what is important.
As for the question posed taken literally - consider a cell update binding on the tab dataset. I can't remember for sure, but I think the style customizer isn't sufficiently powerful to animate different tabs, but a cell update binding can do so.
I was able to implement this in my test environment with the following procedure:
• First, I added a Boolean custom property to my tab strip called isWarning
• Then, I bound the property to my Boolean test tag
• Finally, added this script to the tab strip's propertyChange event handler:
# Trigger this script only when the isWarning custom property changes state
if event.propertyName == 'isWarning':
# Set the icon path to the warning picture if the property has become True
# ...else, set the icon path to blank
iconPath = 'Builtin/icons/16/warning.png' if event.newValue else ''
# Get the tabData dataset
tabData = event.source.tabData
# Create an updated dataset by changing the selected image path of the tab data
# CHANGE THE ZERO IN THE system.dataset.setValue call to the row of the tab you wish to add the icon to
updatedTabData = system.dataset.setValue(tabData, 0, 'SELECTED_IMAGE_PATH', iconPath)
# Update the unselected image path of the dataset, so the icon is present whether or not the tab is selected
updatedTabData = system.dataset.setValue(updatedTabData, 0, 'UNSELECTED_IMAGE_PATH', iconPath)
# Write the updated dataset back to the tabData property
event.source.tabData = updatedTabData