Charmed Quark Systems, Ltd. - Support Forums and Community

Full Version: Widget color and states
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
Dean, 

Is it possible to change a field text widget's color depending on the value in the field? In my example, it's the status on a garage door. It can be "Closed", "Closing", "Opening" or "Open". I would like it to be shown with different colors. Maybe green when closed, yellow when opening or closing and red when open.

Thanks.
Check boxes can do that. There's a 'use state based colors' option on the check box that lets you select different fgn/bgn colors based on the true/false state. That would probably work.
I don't think that will work in my case because CQC may not be the one opening or closing the door. Seems like it would need to be a state type thing. If the field is equal to "closed", set widget color to "Green", if the field is not equal to "closed", set widget color to "Red". Something like that.
But the colors are driven by the state of the check box which is driven by the state of the associated field (in the case of a field base check box.) If the check box is set up on a text field you can set the expression to decide whether it's true or false based on the field value.
So you don't have to actually click on the check box for the color to follow the field value?
Actually, I think a good example would be the power status field in a V2 TV driver. The status field can be either Off, Starting, Ready, Stopping or Failed. Would you be able to display each of those different values in a different color or at least three? Ready in green. Off in red. Stopping and starting in yellow. Maybe failed in orange. Something like that?
Assuming that field is enumerated, you can do that with an Field Enumerated Image Widget.   You select the field, and then in the Image List Editor, for each of the enumerated images, select what image you want.

I used this with the Elk V2 driver - each zone is either Secure, Not Ready, Violated, Bypassed, or Unknown.  I have each of those set up in the Image List Editor to have a different color image, and it works great.
[attachment=2510]
Got it. Thanks.
(08-10-2020, 05:16 PM)bryanb Wrote: [ -> ]So you don't have to actually click on the check box for the color to follow the field value?

No, the click is just for you to change it from the button. All field based widgets track the value of their field and update accordingly.
So that would not apply to a field text widget, correct? A field text widget only has one text color, correct? So is there a way to handle the V2 TV or Projector power status field where the field could be either off, warming up, cooling down or ready? It would be nice to display those in at least 3 colors. Ready in green, off in red and cooling down and warming up in yellow. Something like that.

Thanks.
Pages: 1 2