scale w/ ticks and snap-to

Jim Hurley jhurley at infostations.com
Sun Feb 27 07:25:11 CST 2005


>
>Message: 2
>Date: Sat, 26 Feb 2005 15:15:07 -0800
>From: Richard Gaskin <ambassador at fourthworld.com>
>Subject: scale w/ ticks and snap-to
>To: How to use Revolution <use-revolution at lists.runrev.com>
>Message-ID: <422102FB.2070306 at fourthworld.com>
>Content-Type: text/plain; charset=ISO-8859-1; format=flowed
>
>I'd like to have a scale in a range from 1 to 5 with 5 ticks on it, and
>with snap-to behavior so this indicator will line up with the ticks.
>
>Any combination of properties for this, or am I rolling my own?
>
>--
>   Richard Gaskin
>   Fourth World Media Corporation
>   ___________________________________________________________
>   Ambassador at FourthWorld.com       http://www.FourthWorld.com

Richard,

If you are willing to wait for mouseUp to see the snap then maybe 
this would help:

local tNearestInteger

on scrollbarDrag tPos
   set the startvalue of me to 1
   set the endvalue of me to 5
   put round(tPos) into tNearestInteger
   put tNearestInteger into field 1
end scrollbarDrag

on mouseUP
   set the thumbposition of me to tNearestInteger
end mouseUP

Jim



More information about the use-livecode mailing list