Scrolling stack!

Glen L. Bledsoe glenbledsoe at mac.com
Wed Jul 31 12:25:01 EDT 2002


On Wednesday, July 31, 2002, at 02:44  AM, use-revolution-
request at lists.runrev.com wrote:

>> I'm working on a stack which is vertically taller than the monitors of
>> some of the machines it will run on. In SuperCard I could set the 
>> window
>> style to scrolling. Is there something comparable in RR? Or a clever
>> workaround?
>
> You can group everything and give the group a scroll-bar (select in the
> property palette of the group the 'group'-tab and look at the bottom of 
> the
> palette).
>
>
Thanks, Terry and Jeanne. While waiting for your suggestion, another one 
occurred to me. Scroll the whole stack by adjust the loc of the stack.

This works in my case anyway. I want to print forms on 8 1/2 x 11 sheets 
of paper. Some screen resolutions won't show the whole stack. Rather 
than mess with scroll bars, I put together the scripts below and put 
them at the stack level. This scrolls the whole stack up and adjusts for 
various screenRects.

on openStack
   global gPositionUp,gPositionDown
   if item 4 of the screenRect > 850 then
     put "false" into gPositionDown
     exit openStack
   else
     put "285,430" into gPositionUp
     put "285," & ((item 4 of the screenRect)-374) into gPositionDown
   end if
   set the loc of this stack to gPositionUp
end openStack

on mouseUp
   global gPositionUp,gPositionDown
   if gPositionDown = "false" then exit mouseUp
   if the loc of this stack = gPositionUp then
     repeat
       if the loc of this stack = gPositionDown then exit repeat
       get the loc of this stack
       add -1 to item 2 of it
       set the loc of this stack to it
     end repeat
   else if the loc of this stack = gPositionDown then
     repeat
       if the loc of this stack = gPositionUp then exit repeat
       get the loc of this stack
       add 1 to item 2 of it
       set the loc of this stack to it
     end repeat
   else
     set the loc of this stack to gPositionUp
   end if
end mouseUp

Seems to work and the upward and downward movements are very smooth on 
my Mac. Hope it runs as well on Windows.

Thanks,
Glen L. Bledsoe
Computer teacher
Molalla Elementary School




More information about the Use-livecode mailing list