Stupid Programming Challenge

Jan Sælid janselid at
Tue Nov 28 15:30:37 EST 2006

J. Landman Gay wrote on 28. november 2006 17:43,

>Could someone post Tereza's whole handler, so those of us who are very 
>lazy don't have to figure it out?

Just for the record and for the searching here is the result of this thread:

I you want to make a custom proportional scrollbar here is two solutions
that will calculate the thumbsize of the scrollbar and the endvalue. These
two solutions are based on a vertical scrollbar object called "scroller"
with a reference to a group called "master". If you want to make a
proportional scrollbar from scratch with your own graphics I think you have
to tweak the calculation a little, but the basics is here:

Solution 1, Tereza snyder:

set endvalue of sb "scroller" to max(0,(formattedHeight of group "master"))
set thumbsize of sb "scroller" to (height of group "master")

Solution 2, Trevor DeVore:

set the thumbposition of sb "scroller" to 0
set thumbsize of sb "scroller" to 100 * (height of group "master" /
formattedheight of group "master")
put formattedheight of group "master" - the height of grp "master" into
IF theEndValue > 0 THEN add the thumbsize of sb "scroller" to theEndValue
ELSE put 0 into theEndValue
set endvalue of sb "scroller" to theEndValue END initScrollbar

That alright, Jacque?


More information about the Use-livecode mailing list