Rotary slider with negative values

Hi all,

I’m trying to implement a rotary slider that functions like a wheel rather than a knob. I would like it for it to be able to take values between -infinity and infinity. In other words, it should spin continuously until the user decides to stop and it should take on larger and larger negative numbers, or larger and larger positive numbers.

As it stands, it implements a range of 0.00 to 9.99. Negative values are effectively mod 10.00, as are positive numbers. If I rotate it counter clockwise, the numbers descend until 0.00, then jump to 9.99 and continue descending.

Is there a way to implement a rotary slider that can go continuously negative and positive?

Thanks in advance.

Derive a new class from jute::Slider, use the slider’s value as a proxy value, override some methods to keep track on how many cycles the slider has performed since mouseDown, and extract your (-inf,+inf) desired value based on that. Meaning that the perceived value used by the wheel is not the slider’s value object, but a class member of your custom slider.

1 Like

I’ll give this a shot. Thanks!