REVO2700 tmdragndrop 3 TM Drag n Drop U Lucida Grande U Lucida Grande U Segoe UI cREVGeometryCache stackID 1933 cREVGeneral handlerList breakpoints breakpointstates bookmarks breakpointconditions tempScript prevHandler stackfileversion 2.7script P }on openStack insert script of btn tmdraglib into front open stack tmDropStack1 open stack tmDropStack2 end openStack ffffff cREVGeometryCacheIDs $1225471012340 18311225470719541 18141225471012341 18321225470648974 18121207957496516 10681225470844300 18201208186863058 18231225465690560 18371208182146812 15401208182145049 15391225470865184 18221208140512941 11361208140503007 11341225465675104 18361225470844299 18191207955492618 10151208182150421 15411207957487387 10671225471329924 11371225471049522 18411225470816711 18181208140499476 11321207957006486 10171225470785980 18161225470785979 18151207958337446 10911225471472493 18571208186878698 18241225470946000 18291225470946001 18301208182143007 15381225471264202 18431225471264203 18441225471071351 18331225465702082 18351208186889650 1825 cREVGeometrycache order total 36 cREVGeneral scriptChecksum SiiG|JO bookmarks handlerList openStackscriptSelection char 109 to 108prevHandler openStacktempScript script
on openStack
insert script of btn tmdraglib into front
open stack tmDropStack1
open stack tmDropStack2
end openStack
C , % & ' ( ) 3 4 q A tmdraglib ewW ---------------------------------------------------------------------------------------------------- # IMPORTANT! ALL OBJECTS THAT CAN BE DRAGGED MUST BE UNIQUELY NAMED! ---------------------------------------------------------------------------------------------------- on tmEnableDrag pObj local tPos,tDragFromStack,tDropRect,tStartLoc,tImage,tNowLoc,tWidth,tHeight,tCopyModeFlag,tRightLocationFlag ----- # CREATE THE DRAG IMAGE if version() < 2.9 then # NOTE THERE IS A PRE-2.9 BUG IN THE EXPORT COMMAND THAT PREVENTS # A SNAPSHOT FROM CORRECTLY CAPTURING THE LOCAL OBJECT RECT # UNLESS A SHORT OBJECT REFERENCE IS USED put word 1 of name of pObj into objType put short name of pObj into objName do "export snapshot from rect (rect of pObj) of" && objType && quote & objName & quote && "to tImage as PNG" else # VERSION 2.9 AND LATER export snapshot from rect (rect of pObj) of pObj to tImage as PNG end if ----- put the short name of this stack into tDragFromStack put globalLoc(loc of pObj) into tPos -- storing initial location ----- # ESTABLISH DROP REGION if "tmdropstack" is not among the lines of the openStacks then go stack tmdropstack set the defaultStack to the mainStack of this stack end if put rect of stack tmDropStack into tDropRect set the defaultStack to tDragFromStack ----- put the screenMouseLoc into tStartLoc put width of pObj into tWidth put height of pObj into tHeight put item 1 of the clickLoc - item 1 of loc of pObj into xOffset put item 2 of the clickLoc - item 2 of loc of pObj into yOffset ----- # CHECK IF READY TO START DRAG lock messages repeat # CHECK FOR MOUSE MOVEMENT BEFORE DRAG (AT LEAST 6 PIXELS HORIZONTALLY) put the screenMouseLoc into tNowLoc if abs(item 1 of tNowLoc - item 1 of tStartLoc) < 6 then if the mouse is up then exit tmEnableDrag next repeat else exit repeat end if end repeat ----- # BUILD DRAG STACK reset the templateStack -- just in case set the name of the templateStack to "controlAvatar" set the visible of the templateStack to false set the decorations of the templateStack to "noShadow" set the style of the templateStack to "palette" set the blendLevel of the templateStack to 25 create stack reset the templateStack set the defaultStack to "controlAvatar" set the loc of this stack to tPos -- initial thumb location set the minWidth of this stack to tWidth set the minHeight of this stack to tHeight set the width of this stack to tWidth set the height of this stack to tHeight set backcolor of this cd to 128,128,128 set the showBorder of this cd to false set the threeD of this cd to false ----- # ADD DRAG IMAGE reset the templateImage -- just in case set the width of the templateImage to tWidth set the height of the templateImage to tHeight set the lockloc of the templateImage to true set the text of the templateImage to tImage create image reset the templateImage -- to default for others set the loc of img 1 to the loc of this card set the backPattern of this cd to the id of img 1 # READY FOR DRAG show this stack set the windowShape of this stack to id of img 1 of this stack ----- # MOUSE TRACKING LOOP repeat set the loc of this stack to item 1 of the screenMouseLoc - xOffset,item 2 of the screenMouseLoc - yOffset -- global coordinates put (the screenMouseLoc is within tDropRect) into tRightLocationFlag if tRightLocationFlag then set rect of grc hiliter of stack tmDropStack to 0,0,width of stack tmDropStack,height of stack tmDropStack show grc hiliter of stack tmDropStack else hide grc hiliter of stack tmDropStack end if if the mouse is up then exit repeat -- stop end repeat ----- if tRightLocationFlag then # ALLOW DROP do "copy" && long id of pObj && "to stack tmDropStack" # HANDLE AS "DO" STATEMENT FOR WINDOWS put it into droppedObj stripDnD droppedObj # OPTIONAL: PREVENT RE-DRAGGING OF DROPPED OBJECT put item 1 of the screenMouseLoc - left of stack tmDropStack - xOffset into Xloc put item 2 of the screenMouseLoc - top of stack tmDropStack - yOffset into Yloc set loc of droppedObj to Xloc,Yloc else # NO DROP move this stack to tPos in 200 millisecs end if delete stack controlAvatar # DONE WITH DRAG STACK hide grc hiliter of stack tmDropStack unlock messages end tmEnableDrag on stripDnD pObj set script of pObj to "" if word 1 of name of pObj = "group" then repeat with N = 1 to number of controls of pObj set script of control N of pObj to "" end repeat end if end stripDnD [ 0 tmDragLib cREVGeneral scriptChecksum ]On| uhandlerList tmEnableDrag stripDnDscriptSelection char 2 to 1scripteditorvscroll 0 bookmarks revUniqueID 1207955492618scripteditorselection 0prevHandler tmEnableDragtempScript script----------------------------------------------------------------------------------------------------
# IMPORTANT! ALL OBJECTS THAT CAN BE DRAGGED MUST BE UNIQUELY NAMED!
----------------------------------------------------------------------------------------------------
on tmEnableDrag pObj
local tPos,tDragFromStack,tDropRect,tStartLoc,tImage,tNowLoc,tWidth,tHeight,tCopyModeFlag,tRightLocationFlag
-----
# CREATE THE DRAG IMAGE
if version() < 2.9 then
# NOTE THERE IS A PRE-2.9 BUG IN THE EXPORT COMMAND THAT PREVENTS
# A SNAPSHOT FROM CORRECTLY CAPTURING THE LOCAL OBJECT RECT
# UNLESS A SHORT OBJECT REFERENCE IS USED
put word 1 of name of pObj into objType
put short name of pObj into objName
do "export snapshot from rect (rect of pObj) of" && objType && quote & objName & quote && "to tImage as PNG"
else
# VERSION 2.9 AND LATER
export snapshot from rect (rect of pObj) of pObj to tImage as PNG
end if
-----
put the short name of this stack into tDragFromStack
put globalLoc(loc of pObj) into tPos -- storing initial location
-----
# ESTABLISH DROP REGION
if "tmdropstack" is not among the lines of the openStacks then
go stack tmdropstack
set the defaultStack to the mainStack of this stack
end if
put rect of stack tmDropStack into tDropRect
set the defaultStack to tDragFromStack
-----
put the screenMouseLoc into tStartLoc
put width of pObj into tWidth
put height of pObj into tHeight
put item 1 of the clickLoc - item 1 of loc of pObj into xOffset
put item 2 of the clickLoc - item 2 of loc of pObj into yOffset
-----
# CHECK IF READY TO START DRAG
lock messages
repeat # CHECK FOR MOUSE MOVEMENT BEFORE DRAG (AT LEAST 6 PIXELS HORIZONTALLY)
put the screenMouseLoc into tNowLoc
if abs(item 1 of tNowLoc - item 1 of tStartLoc) < 6 then
if the mouse is up then exit tmEnableDrag
next repeat
else
exit repeat
end if
end repeat
-----
# BUILD DRAG STACK
reset the templateStack -- just in case
set the name of the templateStack to "controlAvatar"
set the visible of the templateStack to false
set the decorations of the templateStack to "noShadow"
set the style of the templateStack to "palette"
set the blendLevel of the templateStack to 25
create stack
reset the templateStack
set the defaultStack to "controlAvatar"
set the loc of this stack to tPos -- initial thumb location
set the minWidth of this stack to tWidth
set the minHeight of this stack to tHeight
set the width of this stack to tWidth
set the height of this stack to tHeight
set backcolor of this cd to 128,128,128
set the showBorder of this cd to false
set the threeD of this cd to false
-----
# ADD DRAG IMAGE
reset the templateImage -- just in case
set the width of the templateImage to tWidth
set the height of the templateImage to tHeight
set the lockloc of the templateImage to true
set the text of the templateImage to tImage
create image
reset the templateImage -- to default for others
set the loc of img 1 to the loc of this card
set the backPattern of this cd to the id of img 1
# READY FOR DRAG
show this stack
set the windowShape of this stack to id of img 1 of this stack
-----
# MOUSE TRACKING LOOP
repeat
set the loc of this stack to item 1 of the screenMouseLoc - xOffset,item 2 of the screenMouseLoc - yOffset -- global coordinates
put (the screenMouseLoc is within tDropRect) into tRightLocationFlag
if tRightLocationFlag then
set rect of grc hiliter of stack tmDropStack to 0,0,width of stack tmDropStack,height of stack tmDropStack
show grc hiliter of stack tmDropStack
else
hide grc hiliter of stack tmDropStack
end if
if the mouse is up then exit repeat -- stop
end repeat
-----
if tRightLocationFlag then # ALLOW DROP
do "copy" && long id of pObj && "to stack tmDropStack" # HANDLE AS "DO" STATEMENT FOR WINDOWS
put it into droppedObj
stripDnD droppedObj # OPTIONAL: PREVENT RE-DRAGGING OF DROPPED OBJECT
put item 1 of the screenMouseLoc - left of stack tmDropStack - xOffset into Xloc
put item 2 of the screenMouseLoc - top of stack tmDropStack - yOffset into Yloc
set loc of droppedObj to Xloc,Yloc
else # NO DROP
move this stack to tPos in 200 millisecs
end if
delete stack controlAvatar # DONE WITH DRAG STACK
hide grc hiliter of stack tmDropStack
unlock messages
end tmEnableDrag
on stripDnD pObj
set script of pObj to ""
if word 1 of name of pObj = "group" then
repeat with N = 1 to number of controls of pObj
set script of control N of pObj to ""
end repeat
end if
end stripDnD
hE on mouseUp if the hilite of me then insert script of btn tmdraglib into front else remove script of btn tmdraglib from front end mouseUp cREVGeneral scriptChecksum ҷ$revUniqueID 1207957006486 bookmarks handlerList mouseUptempScript prevHandler mouseUpscriptSelection char 122 to 121scripton mouseUp
if the hilite of me then
insert script of btn tmdraglib into front
else remove script of btn tmdraglib from front
end mouseUp
, add2.png 9on mouseDown tmEnableDrag long id of me end mouseDown 4 0 0 PNG IHDR 0 0 W *tEXtCreation Time Mi 1 Okt 2003 00:07:23 +0100y-g tIME3C pHYs d_ gAMA a IDATxZnEY_R%Ay+Q> $^x !P ILb9יnӻDg%{LfwOU: ݏ}:ɯ}y JHMP|Rz^o9>-~O u)_^qr'|.zϯLez}qȮn Q3 oYC H} 8]x LxptvS襱)4x |FHbTy8އ'#+8:`N3 4~lh!,5GjX|bڳ"HTs q,#AL%p: ,r!cs?Nu2 3AԞ (gp%tHDϋg +bPh ㊗ 9_GʪS% u)Z%)wݗ/'w$VQ價:hz1-V2KÚ7z_['aX[/M*D.RaۛTWX;0#䲂Pҥ[;vlTc4$ڽ ܿѪX5a77Nm?P$#ӄ%1/Rς'5AWpB~. HTcya'i)g{? bMd8hݫYG RzVQڨtnp]Md:P}-]ṍҵM?IY߸,A8