From: Vadim Zeitlin Date: Sun, 29 Jul 2012 22:08:31 +0000 (+0000) Subject: Remove workaround for slow scrolling in wxStyledTextCtrl. X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/42a4299bb35c18dfce9478221ab0af3b7e2e5360 Remove workaround for slow scrolling in wxStyledTextCtrl. We don't need to drop mouse wheel events coming too fast after the previous commit as now scrolling in wxStyledTextCtrl works quickly enough. Closes #9057. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@72255 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/include/wx/stc/stc.h b/include/wx/stc/stc.h index 7956d13f8e..0bddcfd8bd 100644 --- a/include/wx/stc/stc.h +++ b/include/wx/stc/stc.h @@ -4291,9 +4291,6 @@ protected: bool m_lastKeyDownConsumed; - // Time until when we should ignore any new mouse wheel events. - wxLongLong m_timeToBlockWheelEventsUntil; - friend class ScintillaWX; friend class Platform; #endif // !SWIG diff --git a/src/stc/stc.cpp b/src/stc/stc.cpp index 20aff095a3..15f1fcac53 100644 --- a/src/stc/stc.cpp +++ b/src/stc/stc.cpp @@ -199,7 +199,6 @@ bool wxStyledTextCtrl::Create(wxWindow *parent, m_swx = new ScintillaWX(this); m_stopWatch.Start(); m_lastKeyDownConsumed = false; - m_timeToBlockWheelEventsUntil = 0; m_vScrollBar = NULL; m_hScrollBar = NULL; #if wxUSE_UNICODE @@ -4258,25 +4257,11 @@ void wxStyledTextCtrl::OnContextMenu(wxContextMenuEvent& evt) { void wxStyledTextCtrl::OnMouseWheel(wxMouseEvent& evt) { - // Prevent having an event queue with wheel events that cannot be processed - // reasonably fast (see ticket #9057) by ignoring all of them that happen - // during the time interval corresponding to the time it took us to handle - // the last one. - // - // Notice the use of TimeInMicro() instead of Time() to avoid overflow in - // long running programs. - if ( m_timeToBlockWheelEventsUntil <= m_stopWatch.TimeInMicro() ) - { - const wxLongLong beforeMouseWheel = m_stopWatch.TimeInMicro(); - m_swx->DoMouseWheel(evt.GetWheelRotation(), - evt.GetWheelDelta(), - evt.GetLinesPerAction(), - evt.ControlDown(), - evt.IsPageScroll()); - const wxLongLong afterMouseWheel = m_stopWatch.TimeInMicro(); - m_timeToBlockWheelEventsUntil = afterMouseWheel; - m_timeToBlockWheelEventsUntil += afterMouseWheel - beforeMouseWheel; - } + m_swx->DoMouseWheel(evt.GetWheelRotation(), + evt.GetWheelDelta(), + evt.GetLinesPerAction(), + evt.ControlDown(), + evt.IsPageScroll()); } diff --git a/src/stc/stc.cpp.in b/src/stc/stc.cpp.in index 10ceabad07..114d4b71be 100644 --- a/src/stc/stc.cpp.in +++ b/src/stc/stc.cpp.in @@ -199,7 +199,6 @@ bool wxStyledTextCtrl::Create(wxWindow *parent, m_swx = new ScintillaWX(this); m_stopWatch.Start(); m_lastKeyDownConsumed = false; - m_timeToBlockWheelEventsUntil = 0; m_vScrollBar = NULL; m_hScrollBar = NULL; #if wxUSE_UNICODE @@ -762,25 +761,11 @@ void wxStyledTextCtrl::OnContextMenu(wxContextMenuEvent& evt) { void wxStyledTextCtrl::OnMouseWheel(wxMouseEvent& evt) { - // Prevent having an event queue with wheel events that cannot be processed - // reasonably fast (see ticket #9057) by ignoring all of them that happen - // during the time interval corresponding to the time it took us to handle - // the last one. - // - // Notice the use of TimeInMicro() instead of Time() to avoid overflow in - // long running programs. - if ( m_timeToBlockWheelEventsUntil <= m_stopWatch.TimeInMicro() ) - { - const wxLongLong beforeMouseWheel = m_stopWatch.TimeInMicro(); - m_swx->DoMouseWheel(evt.GetWheelRotation(), - evt.GetWheelDelta(), - evt.GetLinesPerAction(), - evt.ControlDown(), - evt.IsPageScroll()); - const wxLongLong afterMouseWheel = m_stopWatch.TimeInMicro(); - m_timeToBlockWheelEventsUntil = afterMouseWheel; - m_timeToBlockWheelEventsUntil += afterMouseWheel - beforeMouseWheel; - } + m_swx->DoMouseWheel(evt.GetWheelRotation(), + evt.GetWheelDelta(), + evt.GetLinesPerAction(), + evt.ControlDown(), + evt.IsPageScroll()); } diff --git a/src/stc/stc.h.in b/src/stc/stc.h.in index ab4ddab4ba..0526edef8b 100644 --- a/src/stc/stc.h.in +++ b/src/stc/stc.h.in @@ -489,9 +489,6 @@ protected: bool m_lastKeyDownConsumed; - // Time until when we should ignore any new mouse wheel events. - wxLongLong m_timeToBlockWheelEventsUntil; - friend class ScintillaWX; friend class Platform; #endif // !SWIG