Field height Adjuster Button

Sannyasin Sivakatirswami katir at hindu.org
Wed Sep 4 22:10:01 EDT 2002


Thanks Sarah for the tip:

This was my first hack from the REV UI...

Actually the need was much more simply implemented, but rev script 
provided the all important good example  of a non-polling mousemove 
structure.

Occasionally it nice to see some simple stuff amidst all the wizardry 
going on here... so... for newbies lurking:

This script will track the movement of a small button adjusting the   
heights of two fields that are placed one above the other with the 
button between them with this script. (I used a small horizontal red 
square button.) In this case the fields are named "toDo' and "Calendar"

========

local lStartMoving

on mouseDown
   put true into lStartMoving
end mouseDown

on mouseUp
   put false into lStartMoving
end mouseUp

on mouseRelease
   mouseUp
end mouseRelease

on mouseMove x,y
   if lStartMoving then
     lock screen
     set the top of me to y
     set the rect of fld "toDo" to item 1 to 3 of the rect of fld 
"toDo", y
      set the rect of fld "Calendar" to the left of fld "toDo",y,the 
bottomRight of fld "Calendar"
     unlock screen
   end if
end mouseMove

on mouseEnter
   set cursor to 201582
   set the lockCursor to true
end mouseEnter

on mouseLeave
   set the lockCursor to false
end mouseLeave




More information about the use-livecode mailing list