09-07-2018 04:31 PM
Is it possible to resize Radio Buttons? I have been poking around with one and believe that it is impossible.
I would like to use a row of Radio Buttons to select what screen to display on a touch screen monitor.
What is the easiest way to make a row (Array?) of Boolean Controls act like a Radio Button control?
Solved! Go to Solution.
09-07-2018 04:39 PM
So where's your code?
I've been known to create a Cluster of Boolean LEDs (a Cluster, since that allows me to space them as I wish them to look, an LED, as it can be a Control, but can also be programmatically "set", and as a Cluster element, I can also name each of them) for just this purpose ... Don't have one handy at the moment, but I think you get the idea.
One of my fancier ones (serving as a "Select Me if Pushed" and "Show Status") used a 6 x 4 Array of these things, each one with a Boolean Reference gathered into an Array of References. The "simple thing" I could do was turn programmatically turn it On or Off (set Value to T or F). I could also "fake a button press" (use Value-signalling). For Status, I changed the Color mapping -- Green (Bright and Dull) was OK, Yellow was Caution, Red was Failing, and Black was "off line" (it didn't have a different "Off" color -- Dead = Dead).
Bob Schor
09-07-2018 04:45 PM
@Bob_Schor wrote:
So where's your code?
Oh yeah, here you go 😛
The cluster sounds like a good idea, thanks.
09-07-2018 05:30 PM - edited 09-07-2018 05:34 PM
Hey I finally found a use for the Event Structure!
My first time ever... So be kind 😛
09-07-2018 06:07 PM - edited 09-07-2018 06:11 PM
Not related to your code, but original question. Check out DMC
=> (It's Free)
You can get Radio buttons that look like this, and are resizable, it's a good target for a touch screen. I have added individual decals in the past to the buttons.
mcduff
EDIT:
Here's a customized version of the control.
09-07-2018 06:25 PM - edited 09-08-2018 12:51 PM
I guess I don't understand the question. A radiobutton control is just a special container for booleans (any type, flavor, amount) with some logic that only the last pressed is true.
The type is an enum containing the labels of the Boolean as item names. The value is the current selection.
Like clusters, you can arrange the elements any way you want (turn off autosizing, arrange horizontally, etc.)
Yes, before radiobuttons, we had to make our own logic. (Still true for special versions. I have one where the last two are true ;))
(Posting by phone, cannot test you snippet)
09-07-2018 06:31 PM
Alternately, you could use a tab control with the actual bit of the tab you'd normally put things in resized to zero height. It would eliminate the need to have actual code running that turns off any other Boolean that's part of the cluster that's already on. Not perfect, but it might be simpler.
09-07-2018 06:41 PM
Since CA can't post code, I'll take advantage of his do more with less motto.
If you put all of your booleans in a cluster, then you can do the following:
mcduff
09-07-2018 06:51 PM - edited 09-07-2018 06:53 PM
@mcduff wrote:
Since CA can't post code, I'll take advantage of his do more with less motto.
Similar to my ancient code, but "not equal" would do the same as XOR, but be less cryptic. Also try to add logic for "allow no selection", ie pressing the active element would turn all off.
Also, that was before the event structure...
09-07-2018 06:55 PM
I seriously did not see your ancient code, but am not surprised that you already solved the question before it was asked.
You are correct that it is missing logic, like no selection, etc.
Cheers,
mcduff