Show PopupDisplay on a Slider on mouse wheel event

With setPopupDisplayEnabled() you can chose whether to show the Popup Display when the slider is dragged or when the mouse is over the component, but in no way you can show the popup display only when you use the wheel to set the value of a slider and not when the mouse pointer is just over the component (which in most cases conflicts with the ToolTip window).

The only solution I have found is to modify the juce_Slider.cpp file at the Pimpl::mouseWheelMove() function ad add these lines after the setValue() call:

					if (popupDisplay == nullptr)

					if (popupDisplay != nullptr && popupHoverTimeout != -1)

But, honestly, I hate to modify the source code of a library, mostly because at the next update I must remember to modify the file again.

Can somebody suggest an equivalent method to detect the mouse wheel movement without having to override the entire function and invoke showPopupDisplay()?

It saddens me to see this feature request ignored after 6 months…
Apparently there’s no way to override this code in the user project. Modifying that library file is the only way I found, and it still works on the last version of Juce. Plus, it’s very annoying having to modify these files each time Juce is updated.

I agree with you, I was thinking about this very issue today. I tried your code, and it works great. JUCE 6.0.7.

But, like you, I wish some of these issues would be addressed. Now I have another little source code modification to track and remember to update when the next version comes out.

Unfortunately, I don’t have any votes to apply to this. :slightly_frowning_face:

Maintaining a fork is easier than remembering which files you need to update, but still can be painful.

I never needed to modify the base Slider class to do that, even when I was on Juce 3. I have my own class that inherits from Slider and I’ve overridden the various mouse callbacks to make this working. I can change the value of the parameter with only the mouse wheel without having to click on it first .

Yes, that can be done by just calling setScrollWheelEnabled(true) which should be true by default at least since Juce 5. The problem is having the default popupDisplay to show up without having to rewrite the entire class.

I don’t have my own fork, I have created a patch that I can apply when the repository is updated.