From 4177593aef9d50da0a19eb4940be17e883c08cc2 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 6 Sep 2015 19:40:03 +0200 Subject: [PATCH] Fix vertical wheel scrolling direction in wxGenericCalendarCtrl Make scrolling upwards (positive delta) go to the past (i.e. decrease the date) for consistency with the native calendar controls. See https://github.com/wxWidgets/wxWidgets/commit/50daf1feabc42fdd14b534339b4b3bd654a5989c#commitcomment-13087042 --- src/generic/calctrlg.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/generic/calctrlg.cpp b/src/generic/calctrlg.cpp index d75758ad75..97db680459 100644 --- a/src/generic/calctrlg.cpp +++ b/src/generic/calctrlg.cpp @@ -1519,7 +1519,10 @@ void wxGenericCalendarCtrl::OnWheel(wxMouseEvent& event) switch ( event.GetWheelAxis() ) { case wxMOUSE_WHEEL_VERTICAL: - span = wxDateSpan::Month(); + // For consistency with the native controls, scrolling upwards + // should go to the past, even if the rotation is positive and + // could be normally expected to increase the date. + span = -wxDateSpan::Month(); break; case wxMOUSE_WHEEL_HORIZONTAL: