[TIDBIT] Group grab and drag
FlexibleLearning at aol.com
FlexibleLearning at aol.com
Sun Jul 17 12:59:57 EDT 2005
A tidbit for your Scripter's Scrapbook:
- How to use the mouse to grab and drag a scrolling group
(see also the 'Grab' command in the Transcript dictionary to grab and drag
an object)
Put this in the script of your scrolling group...
-----
local GrabMe,xOff,yOff
on mouseDown
put "true" into GrabMe
put item 1 of the mouseLoc into xOff
put item 2 of the mouseLoc into yOff
end mouseDown
on mouseMove x,y
if GrabMe then
if the mouse is "up" then
put "false" into GrabMe
exit mouseMove
end if
set the hScroll of me to (the hScroll of me + xOff - x)
set the vScroll of me to (the vScroll of me + yOff - y)
put x into xoff
put y into yoff
end if
end mouseMove
-----
/H
The Scripter's Scrapbook
www.FlexibleLearning.com/ssbk.htm
More information about the use-livecode
mailing list