In GRAB control

Alejandro Tejada capellan2000 at gmail.com
Sun Oct 15 15:05:16 EDT 2017


Hi Richmond,

Tell me if this recipe works in your own setup:

1) Import an image
2) Create a small rectangle graphic with no fill
(rectangles without fill is the default style)
3) Paste this script into the image:

local tLocation, OriginalXposition, OriginalYposition

on mouseDown
   put  the loc of me into tLocation
   put item 1 of tLocation into OriginalXposition
   put item 2 of tLocation into OriginalYposition
   set the rect of grc 1 to the rect of me
   grab me
end mouseDown

on mouseup
   set the rect of grc 1 to "10,10,30,30"
end mouseup


on mousemove
     put the loc of me into tNewLocation
     put item 1 of tNewLocation into tx
     put item 2 of tNewLocation into ty

   switch

      case ty < OriginalYposition and tx < OriginalXposition
         put "Moving Up and Left"
         break
      case ty > OriginalYposition and tx < OriginalXposition
         put "Moving Down and Left"
         break

      case ty < OriginalYposition and tx > OriginalXposition
         put "Moving Up and Right"
         break
      case ty > OriginalYposition and tx > OriginalXposition
         put "Moving Down and Right"
         break

      case ty < OriginalYposition and tx = OriginalXposition
         put "Moving Up"
         break
      case ty > OriginalYposition and tx = OriginalXposition
         put "Moving Down"
         break

      case tx < OriginalXposition and ty = OriginalYposition
         put "Moving Left"
         break
      case tx > OriginalXposition and ty = OriginalYposition
         put "Moving Right"
         break

   end switch

end mousemove

By the way, Are you using Peter Thirkell SVG Multicolor widget
for the stacks of your classes?

Al



More information about the use-livecode mailing list