custom stack resize contro

J. Landman Gay jacque at hyperactivesw.com
Sun May 29 12:27:06 EDT 2011


On 5/28/11 11:26 PM, dunbarx at aol.com wrote:
> A direct way to do it, though with my quick workup one must move slowly, is to have this in the card or stack script:
>
>
> on mouseMove
>    put the rect of this stack into tRect
>    put the screenMouseLoc into tLoc
>
>
> if item 3 of tRect - item 1 of tLoc<  20 and item 4 of tRect - item 2 of tLoc<  20 then
> set the rect of this stack to item 1 of tRect&  ","&  item 2 of tRect&  ","&  item 1 of tLoc + 15&  ","&  item 2 of tLoc + 15
> end if
> end mouseMove
>
>
> Perhaps it can be improved to allow for faster mouse movements?

local sDrag

on mousedown
   put the rect of this stack into tRect
   put the screenMouseLoc into tLoc
   put (item 3 of tRect - item 1 of tLoc < 20 and \
       item 4 of tRect - item 2 of tLoc < 20) into sDrag
end mousedown

on mouseup
   put false into sDrag
end mouseup

on mouseMove x,y
   if sDrag then
     put the rect of this stack into tRect
     put globalLoc((x,y)) into tLoc
     set the rect of this stack to \
         item 1 of tRect,item 2 of tRect,item 1 of tLoc + 15,item 2 of 
tLoc + 15
   else
     pass mouseMove
   end if
end mouseMove
-- 
Jacqueline Landman Gay         |     jacque at hyperactivesw.com
HyperActive Software           |     http://www.hyperactivesw.com




More information about the use-livecode mailing list