getting "maxscroll" of a group?
    zryip theSlug 
    zryip.theslug at gmail.com
       
    Sat Feb 13 07:36:00 EST 2010
    
    
  
2010/2/13 Klaus on-rev <klaus at major.on-rev.com>:
> Hi all,
>
> as the subject says I am looking for a way to calculate the "maxscroll"
> (maximum h/v-scroll value) of a LocLocked group with content larger
> than the group. Know what I mean?
>
> Thanks in advance!
>
>
> Best
>
> Klaus
>
Hi Klaus,
Why not like this?
constant kBigValue = 999999999
function maxHScroll pTheGroup
   local tCurrentValue, tMaxHScroll
   lock screen
   lock messages
   put the hScroll of pTheGroup into tCurrentValue -- save the current hScroll
   set the hScroll of pTheGroup to kBigValue -- set the hScroll to an
aberant value
   put the hScroll of pTheGroup into tMaxHScroll  -- read the maxValue
   set the hScroll of pTheGroup to tCurrentValue -- revert to the current value
   unlock messages
   unlock screen
   return tMaxHScroll
end maxHScroll
function maxVScroll pTheGroup
   local tCurrentValue, tMaxVScroll
   lock screen
   lock messages
   put the vScroll of pTheGroup into tCurrentValue -- save the current vScroll
   set the vScroll of pTheGroup to kBigValue -- set the vScroll to an
aberant value
   put the vScroll of pTheGroup into tMaxVScroll  -- read the maxValue
   set the vScroll of pTheGroup to tCurrentValue -- revert to the current value
   unlock messages
   unlock screen
   return tMaxVScroll
end maxVScroll
-- 
-Zryip TheSlug- wish you the best! 8)
http://www.aslugontheroad.co.cc
    
    
More information about the use-livecode
mailing list