3-way slider control

J. Landman Gay jacque at hyperactivesw.com
Mon May 24 18:28:39 EDT 2021

On 5/24/21 3:18 PM, Paul Dupuis via use-livecode wrote:
> Hi all,
> I am looking to see if anyone has a 3-positions slider control they might be willing to share. 
> I need a control that has a "left, middle, and Right" positions (whatever they are called). 
> Prefer horizontal orientation and resizable so I can adjust the size to the screen area where 
> it needs to go, but I can resize graphics if needed.

You can do this with LC's built-in horizontal scrollbar. Drag a Slider control to the card. Set 
the start value to 1 and the end value to 3. By default there will be numbers displayed but you 
can turn those off and use labels underneath instead.

Put this script into the slider. It should make the slider snap to one of the three positions:

on scrollBarDrag
   set the thumbPos of me to the thumbpos of me mod(4)
end scrollBarDrag

If you want to change the color, use an effects overlay. None of the built-in color properties 

Jacqueline Landman Gay         |     jacque at hyperactivesw.com
HyperActive Software           |     http://www.hyperactivesw.com

More information about the use-livecode mailing list