scroll ball or wheel script

Scott Morrow scott at elementarysoftware.com
Sat Aug 4 01:28:48 EDT 2012


On Aug 3, 2012, at 7:58 PM, Kathy Jaqua wrote:
> I need a script that adds a vScrollbar script that adds a scroll 
> bar after the field is full.
> 
> I also need a scroll ball or wheel (3ed button) script that allows for scrolling 
> up and down in that field.
> I am on a Mac but it would be needed for windows.

Maybe this will get you started:

both of these scripts use "me" so they need to be placed inside the field script

  -- show or hide a  vert scrollbar
-- this could be triggered from several events
-- as an example, it is placed in the rawKeyDown handler
command ShowHideScrollBar
   if (the formattedHeight of me)>(the height of me) then
      set the vScrollBar of me to "true"
   else
      set the vScrollBar of me to "false"
   end if
end ShowHideScrollBar


   -- use the mouseWheel
on rawKeyDown theKeyNumber
   ShowHideScrollBar

   if theKeyNumber is 65308 then put 15 into tScrollInc -- increaseScroll -- mouse wheel down
   if theKeyNumber is 65309 then put -15 into tScrollInc -- decreaseScroll -- mouse wheel up
   if tScrollInc is empty then pass rawKeyDown -- don't forget this!
   
   set the vScroll of me to (the vScroll of me + tScrollInc)
   
end rawKeyDown


--
Scott Morrow

Elementary Software
(Now with 20% less chalk dust!)
web       http://elementarysoftware.com/
email     scott at elementarysoftware.com
------------------------------------------------------











More information about the use-livecode mailing list