wxSlider: disabling mouse wheel
-
- Experienced Solver
- Posts: 76
- Joined: Tue Nov 06, 2007 11:19 pm
wxSlider: disabling mouse wheel
Hello, I searched information around but couldn't find if it's possible at all to deny wxSlider changes using the mouse wheel. Thanks
Windows 10, MS VC++ 2015 (vc140), WxWidgets 3.11
Re: wxSlider: disabling mouse wheel
Hi,
What platform/wx version?
Did you try to bind mouse event and do nothing in the handler?
Thank you.
What platform/wx version?
Did you try to bind mouse event and do nothing in the handler?
Thank you.
-
- Experienced Solver
- Posts: 76
- Joined: Tue Nov 06, 2007 11:19 pm
Re: wxSlider: disabling mouse wheel
Hi, I am on Windows 10/ wxWidgets 3.13
Yes I did connect the mouse wheel event to an empty function, without success. Here below is code showing the connections:
Yes I did connect the mouse wheel event to an empty function, without success. Here below is code showing the connections:
Code: Select all
Connect(CLOROFILLAWIDGET_SLIDERCONTROLLER, wxEVT_SCROLL_CHANGED, wxScrollEventHandler(ClorofillaSlider::OnRelease)); // connect scroll event
clorofillaSliderController->Bind(wxEVT_MOUSEWHEEL, &ClorofillaSlider::OnWheelDoNothing, this); // catch wheel event
Windows 10, MS VC++ 2015 (vc140), WxWidgets 3.11
-
- Experienced Solver
- Posts: 76
- Joined: Tue Nov 06, 2007 11:19 pm
Re: wxSlider: disabling mouse wheel
I've "fixed" it using a boolean to intercept the wheel event, and when it's true I restore the slider value to it's precedent one. It's kind of a hack but it does what I need.
Windows 10, MS VC++ 2015 (vc140), WxWidgets 3.11