09-15-2008 02:52 PM
I have an application where I am using a boolean control to show green for on time, and red for not on time. The operator selects one of the two states. The true/false value is stored in a database as 0 or 1. I have a need to add yellow as a third state meaning "on hold". This means changing the bit value in the database to a tiny integer which I should be able to do without data loss. Is there a control that would operate perhaps like a menu ring, where all I am displaying is the selected color? This should behave like a tri-state boolean. I am just not sure if this is possible.
Thank you!
09-15-2008 02:56 PM
If you really want three values for the control then look at the Picture Ring. It let's you define a set of picture that the user can choose from (like images of a boolean control with three different colors).
If you still want only true or flase but want to change the color then look a the "colors" property foa boolean.
Ben
09-15-2008 04:49 PM
You can use the "mixed checkbox" from the system palette. It has three states: False/True/mixed.
You can also use a colorbox as indicator, it can even be made to look like an LED.
It seems you want the operator to only select true/False while the third state is generated programmatically.
So you could use mouse-up events to toggle between true/false colors. Disable the control so the color selector does not show.
You cound even make an Xcontrol to simplify coding and define the desired behavior.
Yes another possibility is a picture ring containing 3 pictures of the LED in the desired colors.