wxSlider: disabling mouse wheel
-
- Earned some good credits
- Posts: 118
- 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++ 2019 (vc142), WxWidgets 3.14
Designed with WxWidgets: https://www.facebook.com/clorofillaApp
Designed with WxWidgets: https://www.facebook.com/clorofillaApp
-
- Part Of The Furniture
- Posts: 7481
- Joined: Sat Apr 16, 2005 7:22 am
- Location: USA, Ukraine
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.
-
- Earned some good credits
- Posts: 118
- 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++ 2019 (vc142), WxWidgets 3.14
Designed with WxWidgets: https://www.facebook.com/clorofillaApp
Designed with WxWidgets: https://www.facebook.com/clorofillaApp
-
- Earned some good credits
- Posts: 118
- 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++ 2019 (vc142), WxWidgets 3.14
Designed with WxWidgets: https://www.facebook.com/clorofillaApp
Designed with WxWidgets: https://www.facebook.com/clorofillaApp