in my code I use the SliderListener::sliderDragEnded() callback to trigger the record of an Undo event.
This works quite well but not in the mouseWheelMove callback as it sends it on any mouse wheel change and
unnecessarily fills my Undo list. Okay, could overwrite mouseWheelMove but how to trigger sliderDragEnded()
manually as it is private? Can’t figure out :frowning:



Sorry, it should read “…but how to trigger Slider::sendDragEnd()
manually as it is private?”



making Slider::sendDragEnd() protected wouldn’t really hurt, would it?



In the latest version, that method doesn’t even exist in the slider class any more. And as an implementation method, it wouldn’t be something I’d make public.

Personally, I’d recommend a different approach anyway - I’ve found that the best trick for undoing is to use a timer, and whenever any change happens, you restart the timer for e.g. 2 seconds. Then when the timer finally gets chance to get called, it starts a new transaction.


Thanks Jules,

I had this in mind as well as I am using that way to trigger Undo recording from Midi input
and the latter one, together with the timer you’ve mentioned could mess up the undo timestamp if
both sources (Midi input and Slider) change the same parameter simultaneously.

Anyway, I should probably completely re-write the Undo stuff in my code.