]> git.saurik.com Git - wxWidgets.git/commitdiff
Remove workaround for slow scrolling in wxStyledTextCtrl.
authorVadim Zeitlin <vadim@wxwidgets.org>
Sun, 29 Jul 2012 22:08:31 +0000 (22:08 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Sun, 29 Jul 2012 22:08:31 +0000 (22:08 +0000)
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

include/wx/stc/stc.h
src/stc/stc.cpp
src/stc/stc.cpp.in
src/stc/stc.h.in

index 7956d13f8e886806e0230bd0571ee948371187d9..0bddcfd8bd4cf602a4b3a5ae5575c4301ae1845b 100644 (file)
@@ -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
index 20aff095a3826c460622c5bd7022d8ee614ebc0f..15f1fcac53afa5b8d2cb45a58e16580efd3c70ac 100644 (file)
@@ -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());
 }
 
 
index 10ceabad07057ed48f0bbae89a9a0f77c01a2e8a..114d4b71be95ce6edc962b9041a041dd5e9f5984 100644 (file)
@@ -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());
 }
 
 
index ab4ddab4ba900b56e58fe752ac2b41050cf1f2f2..0526edef8bd12afb7f245280d2aa237b832111ac 100644 (file)
@@ -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