04-30-2020 04:39 PM
Hello All,
I was wondering what would be the best way to go about implementing a radio-button type architecture for a cluster of boolean controls.
My current problem: I have a cluster of boolean controls (12 of them) all sorted in rows of 3. For each control on each row, I would like to disable and gray out the two other controls that are not pressed. This would be similar to radio buttons; however, I would also like to be able to leave all the buttons unpressed (all false).
I'm not exactly sure if the radio buttons could apply in this situation, but I have tried to tinker around using a case structure with property nodes without much luck. I was able to get to a point where I could pull out the labels of the booleans into a case structure. I'm not sure if this would be the best way to go about it, so I'd really appreciate any help. I've attached a picture of the VI down below
Thank you very much
Solved! Go to Solution.
04-30-2020 04:54 PM
Use an event structure. Whenever something in the cluster changes, iterate though all the other controls to disable and grey them, and set them to false when a button is set to true.
When a button is set to false, enable all controls.
04-30-2020 05:34 PM
RavensFan -- Thank you for the speedy reply.
So from my understanding you are suggesting making an event structure for the entire cluster and triggering an event based off a value change inside of the cluster, correct? So essentially it will have one event, and I would have to find the changed element so that I could disable and gray the other two controls on the row.
I wonder if I could create an event structure and add event cases for each boolean in the cluster separately. That way, I could immediately set the condition of the other two controls easily by wiring the new value to a case structure and subsequently using property nodes. May be a bit tedious, but I wouldn't have to go through the extra logic or loops...
04-30-2020 05:49 PM
Is this what you are trying to do?
04-30-2020 06:18 PM
@Garord wrote:
RavensFan -- Thank you for the speedy reply.
So from my understanding you are suggesting making an event structure for the entire cluster and triggering an event based off a value change inside of the cluster, correct? So essentially it will have one event, and I would have to find the changed element so that I could disable and gray the other two controls on the row.
I wonder if I could create an event structure and add event cases for each boolean in the cluster separately. That way, I could immediately set the condition of the other two controls easily by wiring the new value to a case structure and subsequently using property nodes. May be a bit tedious, but I wouldn't have to go through the extra logic or loops...
Exactly.
You create multiple events. But once you get beyond a couple, it is worth the effort of doing loops and would be more easily expandable to X number of controls. I, myself, would go straight to a loop method and a single event.
04-30-2020 07:41 PM
RavensFan -- Thank you for your help, I was able to implement one with the functionality I wanted.
paul_cardinale -- I am unfortunately not able to open your control as I am using LabVIEW 2017 and I believe yours has been saved in LabVIEW 2018. If you don't mind saving for a previous version, I would be more than happy to take a look. Thanks for sending that over.