Moving Buttons...

Chipp Walters chipp at chipp.com
Tue Nov 4 15:05:34 EST 2003


Dan,

Check out the intersect and grab functions.

Also, you shouldn't check
"if the mouse is down" as it steals cycles from other programs and is
generally considered a no no.

Check the drag window script at:

http://www.altuit.com/webs/altuit2/RunRev/UsefulScripts.htm

for the proper way to handle mouseMove stuff.

-Chipp

> On a card, you have a bunch of buttons that are grouped together (group
> "ButtonGroup").  You want to let the user move the buttons around
> - but you
> want to prevent any of the buttons from overlaping.
>
> I have this in the card script to handle the movement:
>
> on mouseMove
>   if not the hilite of btn "lockChanges" then
>     if the mouse is down then
>       if the short name of the owner of the target = "ButtonGroup" then
>         put the short name of the target into butName
>         set the loc of btn butName to the mouseLoc
>       end if
>     end if
>   end if
> end mouseMove
>
> How do you get the button that is being moved to not collide with another
> button.  And, if possible, how can you get the moving button to "snap" to
> the closest button?
>
> Any advise (or code snippet) would be appreciated!
>
> Thanks!
> Dan
>
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> http://lists.runrev.com/mailman/listinfo/use-revolution



More information about the use-livecode mailing list