Grouped Scrolling Fields

MisterX b.xavier at internet.lu
Wed Sep 7 09:09:30 EDT 2005


Hi Joe,

> Here's another newbie question. What's the best way to get 
> several fields to scroll together?

Here's an atomic function that does that
note that some comments were left in case they becase useful agan.

here's a slight variation

Put this script into your card or stack...

on SynchScroll cScroll, fldlist, scrolldirection
  -- 20030111 -- added hscroll option
  lock screen
  local H
  put char 1 of scrolldirection is "H" into H
  if H then
    repeat for each item c in fldlist
      if there is a fld c then
        if the hscroll of fld c is not cScroll
        then set the hscroll of fld c to cScroll
      end if
    end repeat
  else
    repeat for each item c in fldlist
      if the scroll of fld c is not cScroll
      then set the scroll of fld c to cScroll
    end repeat
  end if
  unlock screen
end SynchScroll

Now, i dont know if Klaus spoke for Macs but for windows, it does work for
mouse-scrolling wheels on windows...

To use it just put this script below in all your fields (remember that we
can scroll any of them via a mousedown+drag or scrollwheels, not just the
rightmost scrollbar...

on scrollbardrag x
  put "field1,field2,field3" into fldlist
  SynchScroll x, fldlist, "V"
end scrollbardrag

Anyway, that's not the most advanced version i have but it's enough to get
you started ;)

bests
Xavier
http://monsieurx.com




More information about the use-livecode mailing list