Group buttons?

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Group buttons?

LunchnMeets
Hi,

How do I group some square style buttons so that only one can be hilited at a
time?

Thanks,
Joe
Orlando, Florida
_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
Reply | Threaded
Open this post in threaded view
|

Re: Group buttons?

Jim Ault
On 11/28/06 9:17 AM, "[hidden email]" <[hidden email]> wrote:
 
> How do I group some square style buttons so that only one can be hilited at a
> time?
>
What do you mean by 'hilited at a time'
[1] only one button will work if the user clicks it
[2] operate as if it were a radio button

Are you setting the hilite of a square button when a user clicks and leaving
it on?  This is not the usual way of using a 'push' style button.

Jim Ault
Las Vegas


_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
Reply | Threaded
Open this post in threaded view
|

Re: Group buttons?

Quentin Long
In reply to this post by LunchnMeets
In a message dated 11/28/06 10:05:00 AM, [hidden email] writes:

> How do I group some square style buttons so that only one can be hilited at
> a
> time?
>     This sounds, to me, like you want to have a bunch of square thingies that
*behave* like radiobutton-type buttons, even tho they don't have that funky
filled/unfilled circle off to the left. Presuming I'm right about what you
want, one solution that might serve your needs might be like so:

    First: Make your buttons. Since you're doing nonstandard stuff with the
hilites, you'll have to make sure that autoHilite is turned off for *all* of
them. You'll also want to make sure each button has a unique name -- no
duplicate names here, thanks.
    Second: Group all of your buttons.
    Third: Make sure that each button in the group has a mouseUp handler.
Make sure that each button's mouseUp handler includes the line "RadioLite (the
short name of me)"
    Fourth: Put this handler into the script of the group that contains all
your buttons:

on RadioLite (TheClickedButton)
   repeat with K1 = 1 to the number of buttons in me
     set the hilite of button K1 to (the short name of button K1 =
TheClickedButton)
   end repeat
end RadioLite

    Note that I haven't actually tested this code. I *think* the "number of
buttons in me" bit should work, since the "me" refers to the object that has
the script -- which is, in this case, the group that contains your buttons. The
"set the hilite" line, however, will work and is the key to the whole thing.
The hilite is a Boolean value, i.e., it's either "true" or "false"; this means
you can set a button's hilite to anything, as long as that thing *is* a
Boolean value. Thus, since TheClickedButton is the short name of the button that was
actually clicked on, "the short name of button K1 = TheClickedButton" will be
"false" for every button that's *not* the button that was clicked on, right?
Thus, all not-clicked-on buttons will be unhilited.
    Even if I've messed up, tho, I believe this solution should at least
point the way to a viable solution for you.

--
ANTHRO -- http://anthrozine.com
It's furry. It's the *good* stuff.
_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
Reply | Threaded
Open this post in threaded view
|

Re: Group buttons?

Ken Ray
On 11/28/06 5:26 PM, "[hidden email]" <[hidden email]> wrote:

>     First: Make your buttons. Since you're doing nonstandard stuff with the
> hilites, you'll have to make sure that autoHilite is turned off for *all* of
> them. You'll also want to make sure each button has a unique name -- no
> duplicate names here, thanks.
>     Second: Group all of your buttons.
>     Third: Make sure that each button in the group has a mouseUp handler.
> Make sure that each button's mouseUp handler includes the line "RadioLite (the
> short name of me)"
>     Fourth: Put this handler into the script of the group that contains all
> your buttons:
>
> on RadioLite (TheClickedButton)
>    repeat with K1 = 1 to the number of buttons in me
>      set the hilite of button K1 to (the short name of button K1 =
> TheClickedButton)
>    end repeat
> end RadioLite

You can also do it without putting any code in the buttons (or just a
double-hyphen comment to make sure there's no mouseUp handlers in there),
and add this to the group script:

on mouseUp
  repeat with K1 = 1 to the number of buttons of me
    set the hilite of btn K1 to (the short name of btn K1 = the short name
of the target)
  end repeat
end mouseUp

But either way, you get the idea...

Ken Ray
Sons of Thunder Software, Inc.
Web site: http://www.sonsothunder.com/
Email: [hidden email]


_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution