Have my own LookAndFeel implementation + new Slider Styles

I already succeeded in creating a new drawRotarySlider implementation for my plugin. It was remarkably easy which shows for me again how great the toolkit is that it does not make trivial things very difficult like I've experienced from some other GUI / code solutions in the past.

I also succeeded for a second in creating a new slider style (namely just display a integer number on a bright background when the value > 0, a little like FM8 shows in the mod matrix). This I had a problem with though since I added some binary data to the project. The IntroJucer now seems to have re-copied all JUCE modules. Is there a way to work with IJ without it erasing my work on the custom library versions?

One of two answers,

a) don't edit the copies of the modules, instead edit your local repository (ie. the sources that get copied). If you commit the edits to your local repo, you can still pull, and merge updates, from the main JUCE repo.


b) is it possible your changes don't need to be within the JUCE source files? which files are you changing, and why?

b) I've added a new Slider Style, so next to RotaryHorizontalDrag that I use all the time I have one that behaves the same with the mouse but looks way different, just a background rounded rect with a number on it. So where juces Slider.cpp decides oh this is a rotary let's have it drawn by the function DrawRotarySlider .. it will definitely need an extra else if. Maybe the easiest way to fix is to subclass Slider too (but it's pretty complex code I must say).

a) That's what I'm doing, it appears the IntroJucer (not git pulls) re-copy the library files every time I save the project (which I need to do all the time, swapping out pictures etc). So whenever I save the project in the IntroJucer I'll go and copy the four files now (Slider and Lookandfeel .cpp / .h).

You shouldn't need to subclass Slider at all (or edit the one in JUCE) if you just want to change the look of it.

You need to create your own LookAndFeel subclass and override the various Slider::LookAndFeelMethods such as drawRotarySlider (...). Then you can apply your LookAndFeel to a single slider or your whole app if you need to. See either Component::setLookAndFeel or LookAndFeel::setDefaultLookAndFeel (which is static).

Well I think I do need to though, because I want even different looks for some sliders that both behave like rotaryverticaldrag sliders, and I want some extra properties for the regular rotary sliders, eg whether the filled part of the arc should start on the left, middle or right etc.

Ha. Sorry I just now read your whole comment thoroughly. So a solution would be to have multiple LookAndFeels for these different slider types and apply them just to sliders. I'll think about it.