Page 1 of 1

Slithery sliders

Posted: Tue May 25, 2021 7:16 pm
by richmond62
Over on the Use-list there is a thread currently running about a 3-way slder control.

I read that and got distracted by this:

"I was imagining more of the common "circle inside an oval" "switch" control you see on the web and in apps these days."

Then got myself in serious trouble with this:
-
SShot 2021-05-25 at 21.13.53.png
-
SShot 2021-05-25 at 21.08.44.png
-
Not perfect by a long, long way, but certainly a start.

Re: Slithery sliders

Posted: Tue May 25, 2021 8:41 pm
by paul@researchware.com
That's very slick Richmond, and I'm glad the thread inspired something. This google search illustrates what I was originally looking for (while there are some exceptions in the images that come up, most are on-off 2-position switches that are a "thumb" (often circular) in a oval or rectangular "switch")

https://www.google.com/search?q=sliding ... 0&biw=1920

Re: Slithery sliders

Posted: Thu May 27, 2021 4:21 am
by seaniepie
I've made a multiway switch. It's not perfect but is most the way there.

Screenshot 2021-05-27 at 04.13.41.png
Screenshot 2021-05-27 at 04.13.41.png (15.75 KiB) Viewed 4167 times

Resize the group by drag or script to resize the switch.
Look at the custom properties to change the number of positions and its current position. Also for changing the colours used.
At runtime, dragging the button slides it up and down and releasing snaps it to the nearest switch position.

Enjoy

Re: Slithery sliders

Posted: Thu May 27, 2021 8:29 am
by richmond62
That's groovy, but it has no "Blip".

Re: Slithery sliders

Posted: Thu May 27, 2021 9:49 am
by jmburnod
Hi seaniepie,
Thanks you for share
I get an error if i dont resize group MultiWaySwitch.
numeric: divide by zero
Object MultiWaySwitch
Line put round((tX - sPropsA["pos1"]) / sPropsA["div"]),sPropsA["div"],sPropsA["range"],sPropsA["pos1"]
Hint btnRelease
I added an opencard message to avoid this

Code: Select all

on opencard
   send resizeControl to grp "MultiWaySwitch"
end opencard
Best regards
Jean-Marc