Hilite uncheck one at a time

LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
hamlynart
Posts: 101
Joined: Wed Mar 19, 2008 7:10 pm
Contact:

Hilite uncheck one at a time

Post by hamlynart » Tue Aug 04, 2009 3:08 pm

Hi Folks,

When I group radio buttons I can select to Hilite one at a time and it works fine. If I group check boxes I can also select to Hilite one at a time but unfortunately it doesn't work.

Any Thoughts?

Jim H

gyroscope
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 404
Joined: Tue Jan 08, 2008 3:44 pm
Contact:

Post by gyroscope » Tue Aug 04, 2009 3:27 pm

Hi Jim

As far as I'm aware, radio buttons are designed (coded) to be used that way, i.e function together as a group, but check boxes aren't. I guess you'll have to do your own coding if you needed that...

:)

SparkOut
Posts: 2947
Joined: Sun Sep 23, 2007 4:58 pm

Post by SparkOut » Tue Aug 04, 2009 3:40 pm

Indeed, the point of the checkbox lists is so that a user can choose multiple options from the list, whereas a radio group is deliberately mutually exclusive.
It's not hard to make a group of checkbox buttons do the same thing though:

Code: Select all

on mouseUp
   set the hilitedButton of me to zero
   set the hilite of the target to true
end mouseUp
Put this in the group script and it should highlight the single most recently checked box.
If you want to have an action for each checkbox in the group then you can still code an individual script for the on mouseUp event in each checkbox (or use behaviors of course!) but you will also have to pass the mouseUp message in each handler.

hamlynart
Posts: 101
Joined: Wed Mar 19, 2008 7:10 pm
Contact:

Post by hamlynart » Tue Aug 04, 2009 3:55 pm

Both very interesting and both very useful to know.

Thanks a million.

Jim H

bn
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 4172
Joined: Sun Jan 07, 2007 9:12 pm

Post by bn » Tue Aug 04, 2009 5:19 pm

Jim,

just keep in mind that a user expects muliple checkboxes to be selectable as Sparkout pointed out. You might confuse the users if you force a radiobutton behaviour on checkboxes (Human Interface etc). At least I would be confused.

regards

Bernd

SparkOut
Posts: 2947
Joined: Sun Sep 23, 2007 4:58 pm

Post by SparkOut » Tue Aug 04, 2009 5:43 pm

That's right - I should have said, although it's easy enough to make that behaviour, I don't think it is desired.

Post Reply