RangeSlider


#1

This isn’t quite finished but it works well enough for those who want to tinker with it. It’s a little slider for setting ranges instead of single values.

Here’s a screenshot…

Here’s the source for just the component…
RangeSlider.zip

And here’s an example project so you can try them out straight away.
RangeSliderTest.zip

And finally, if you just want to try it out as a built .exe…
(ReleaseBuild of RangeSliderTest) .exe

Things still left to do…

  • resizing the handles needs bounds fixing
  • i want to put it into a single component with value display built in (those in the example are just painted on the parent after change messages)
  • the function names need tidying up and reorganising
  • more comments
  • allow for vertical slider (needs check in RangeBarHandle)

Despite these omissions at this stage i thought it was a neat fun component. Plus, those of you who are bored and not currently working on a project can think of it as an assignment; build on the Component, completing the above tasks. Learn how the Component works, and see if you can find ways of improving it for your own needs.

Let me know how you get on :slight_smile: i’ll be working on it anyway


#2

done a little more to it:

Compiled win32 .exe demonstration
VC++e Project and source

i’ve got the bounds checking working properly when you’re resizing it now, and have made it look a little nicer.

next things to do:

  • make it possible to have a ‘zero’ gap (that probably means changing how the values are calculated from the handle boundaries; when they’re touching there is still a small range between low and high limits)
  • improve function arrangement and naming (interface)

#3

last update for the day…

It has a bunch of functions for customising; you can set the roundness of the corners (as a float from 0 - 1, where 1 is totally round), you can set the thickness of the range handles, and of course you can set the colours. You can also make vertical range sliders now too, although i’ve got to wait til i’m more awake to do the math to have them with 0 at the bottom! :hihi:

as usual, a test build can be downloaded from here (the app the screenshot is from), and that project can be downloaded from here.


#4

is it possible to activate the velocity sensitive mode like on all the juce sliders? that would make it perfect :wink:


#5