chasing the thumb in a scrollbar

Mark Swindell mdswindell at cruzio.com
Fri Feb 6 01:36:12 EST 2009


Thanks Jackie, Phil, and Craig for your suggestions and solutions.   
Much appreciated.

Mark


On Feb 5, 2009, at 10:26 PM, J. Landman Gay wrote:

> Mark Swindell wrote:
>> The thumbPosition will give you the position of the thumb relative  
>> to the endvalue of the scrollbar itself.  So that if the  
>> scrollbar's endvalue is set to 100 (default) and it's halfway  
>> along, the thumbpos will be 50.  If the endvalue is set to 200, it  
>> will show 100.  But I'm trying to place a graphic based on the  
>> actual thumb position relative to the screen, not the scrollbar.
>
> Divide the thumbpos by the endvalue to get a percentage, and use it  
> to calculate the number of pixels from the scrollbar left (assuming  
> a horizontal scrollbar,) and then add the left of the scrollbar  
> object itself to that number to get the x position of the thumb on  
> the card.
>
> put the thumbpos of sb 1 / the endvalue of sb 1 into tPercent
> put the width of sb 1 * tPercent into tSBPixels
> put the left of sb 1 + tSBPixels into tCdXPos
>
> -- 
> Jacqueline Landman Gay         |     jacque at hyperactivesw.com
> HyperActive Software           |     http://www.hyperactivesw.com
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your  
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution




More information about the Use-livecode mailing list