Chris,
Some code of what you did would be helpful (to see exactly what you want to accomplish with just buttons and checkboxes), but sans that:
For determining whether a checkbox is checked, you can use the following phrase:
This will return true if it is checked, and false otherwise. With this ability, it is a matter of simply keeping track of which checkboxes are highlighted, and which aren't. It would also probably be convenient to have a global variable that keeps track of the number of the checkboxes that are selected (if your controls are not grouped), or a local script variable that serves the same purpose (if your controls are grouped). In this case, I would definitely recommend grouping.
The radioButtonBehavior option is merely a convenience provided to you by the LiveCode folks. Having standalone checkboxes that you must create logic for is the equivalent of having a set of radio buttons, where you elect to set the radioButtonBehavior to false.
How you want to "allow" or "disallow" a user from selecting a third checkbox was not specified in your original post, but is easy to do to using the enabled or visible properties of controls (depending on the look and overall behavior you want).
Code: Select all
set the enabled of button "theButton" to {true|false}//Choose either true or false in your code, omitting the {}
or
Code: Select all
set the visible of button "theButton" to {true|false}
If you do implement the logic in a group (as I recommend), and there is a need to differentiate between which checkboxes are selected, I would use the following code:
Code: Select all
on mouseUp
put the short name of the target into theTarget
switch theTarget
case "button1"
--code here
break
case "button2"
--code here
break
--etc.
end switch
end mouseUp
If you only care about the number of checkboxes that are selected, then in your group handler:
Code: Select all
sNumberChecked = 0
on mouseUp
--add code to count the number of checkboxes whose hilite is true here. Set sNumberChecked accordingly
end mouseUp
With the information given, I'm unsure how or why you would use buttons instead of checkboxes or radio buttons. Some more information will allow me to help you more.
Tom