Stupid Programming Challenge

Jan Sælid janselid at broadpark.no
Tue Nov 28 15:43:13 EST 2006


(damn this formatting.) The lines was not separated. Here it is again,
hopefully it shows right :)


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"
intotheEndValue
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?

Jan





More information about the use-livecode mailing list