How to auto-select radio buttons
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
How to auto-select radio buttons
First time poster:
I have 3 radio buttons. I want radio buttons 2 and 3, to get auto-selected if radio button 1 is manually selected. I have searched for "radio buttons" and could not find relevant content.
Any help is appreciated.
I have 3 radio buttons. I want radio buttons 2 and 3, to get auto-selected if radio button 1 is manually selected. I have searched for "radio buttons" and could not find relevant content.
Any help is appreciated.
Re: How to auto-select radio buttons
1. User Manual (accessible from within LiveCode program) gives an overview of radio buttons.ali wrote:I have searched for "radio buttons" and could not find relevant content.
2. Don't miss the scripting conference materials, downloadable at
http://www.hyperactivesw.com/revscriptc ... ences.html
The third chapter on "Controls" by Klaus is what you need. A must read!
"Radio" buttons have a specific meaning (and characteristic). When you select one, the others are "auto DE-selected", not auto-selected. Is this what you need?
Again, do the scripting conference tutorial mentioned above.
These are in the form of stacks. You open them in LiveCode and follow along.
Regards,
Sri.
Re: How to auto-select radio buttons
What Sri said.
But you can have it any way you want, since you are in charge, though I might suggest using checkBoxes instead of radio buttons.
Anyway, if you are a first time poster, does that mean you have some experience with writing handlers? Let me know, and I will give you a few small learning tasks that will get your buttons in a row.
Craig Newman
But you can have it any way you want, since you are in charge, though I might suggest using checkBoxes instead of radio buttons.
Anyway, if you are a first time poster, does that mean you have some experience with writing handlers? Let me know, and I will give you a few small learning tasks that will get your buttons in a row.
Craig Newman
Re: How to auto-select radio buttons
Below is snippet that does what I needed:
/*
on mouseUp
if the hilite of me then
set the hilite of btn "c2" to true
set the hilite of btn "c3" to true
else
set the hilite of btn "c2" to false
set the hilite of btn "c3" to false
end if
end mouseUp
*/
Note: c1, c2 and c3 are check-button names. c1 manipulates c2 and c3 but not vice versa.
Thanks for your helpful inputs.
/*
on mouseUp
if the hilite of me then
set the hilite of btn "c2" to true
set the hilite of btn "c3" to true
else
set the hilite of btn "c2" to false
set the hilite of btn "c3" to false
end if
end mouseUp
*/
Note: c1, c2 and c3 are check-button names. c1 manipulates c2 and c3 but not vice versa.
Thanks for your helpful inputs.
Re: How to auto-select radio buttons
HI..
Just so.
A little more elegant, and this is only a matter of style:
But if you look at this, you might get a little "Eureka" on the subject of how cool LC is.
Craig
Just so.
A little more elegant, and this is only a matter of style:
Code: Select all
on mouseUp
set the hilite of btn "c2" to the hilite of me
set the hilite of btn "c3" to the hilite of me
end mouseUp
Craig
-
- VIP Livecode Opensource Backer
- Posts: 10052
- Joined: Sat Apr 08, 2006 7:05 am
- Contact:
Re: How to auto-select radio buttons
Put the buttons in a group and the user interaction is handled automatically. To set the hilitedButton of a group see the hilitedButton, hilitedButtonID, and hilitedButtonName properties in the Dictionary.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn