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
This commit is contained in:
@@ -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
|
||||
|
@@ -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());
|
||||
}
|
||||
|
||||
|
||||
|
@@ -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());
|
||||
}
|
||||
|
||||
|
||||
|
@@ -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
|
||||
|
Reference in New Issue
Block a user