I need to prevent a slider movement when mouse wheel is scrolled on
top of it.
I do have wx.EVT_COMMAND_SCROLL_CHANGED event which is getting fired
when ever slider stops after dragging it. This gives me correct place
to setup undo-redo. The above mentioned event is also rapidly getting
fired
when slider is moved using mouse wheel and filling up undo-redo stack
for every changed value.
I need to prevent a slider movement when mouse wheel is scrolled on
top of it.
You can try intercepting the mouse wheel events, but depending on the platform and how the native widget is handling it, that may or may not work.
I do have wx.EVT_COMMAND_SCROLL_CHANGED event which is getting fired
when ever slider stops after dragging it. This gives me correct place
to setup undo-redo. The above mentioned event is also rapidly getting
fired
when slider is moved using mouse wheel and filling up undo-redo stack
for every changed value.
You can start a short timer on the first event, reset it on subsequent events that come before the timer expires, and then only add the item to the undo stack when the event does finally expire after the user stops rolling the wheel.