diff --git a/src/generic/scrlwing.cpp b/src/generic/scrlwing.cpp index d494cbf280..4fcb6a17bf 100644 --- a/src/generic/scrlwing.cpp +++ b/src/generic/scrlwing.cpp @@ -264,9 +264,6 @@ bool wxScrollHelperEvtHandler::ProcessEvent(wxEvent& event) return true; } - if ( processed && event.IsCommandEvent()) - return true; - // For wxEVT_PAINT the user code can either handle this event as usual or // override virtual OnDraw(), so if the event hasn't been handled we need // to call this virtual function ourselves. @@ -285,6 +282,11 @@ bool wxScrollHelperEvtHandler::ProcessEvent(wxEvent& event) return true; } + // If the user code handled this event, it should prevent the default + // handling from taking place, so don't do anything else in this case. + if ( processed ) + return true; + if ( evType == wxEVT_CHILD_FOCUS ) { m_scrollHelper->HandleOnChildFocus((wxChildFocusEvent &)event); diff --git a/src/generic/vscroll.cpp b/src/generic/vscroll.cpp index 10afddad01..38e882bbb0 100644 --- a/src/generic/vscroll.cpp +++ b/src/generic/vscroll.cpp @@ -89,9 +89,6 @@ bool wxVarScrollHelperEvtHandler::ProcessEvent(wxEvent& event) return true; } - if ( processed && event.IsCommandEvent()) - return true; - // For wxEVT_PAINT the user code can either handle this event as usual or // override virtual OnDraw(), so if the event hasn't been handled we need // to call this virtual function ourselves. @@ -110,6 +107,11 @@ bool wxVarScrollHelperEvtHandler::ProcessEvent(wxEvent& event) return true; } + // If the user code handled this event, it should prevent the default + // handling from taking place, so don't do anything else in this case. + if ( processed ) + return true; + // reset the skipped flag (which might have been set to true in // ProcessEvent() above) to be able to test it below bool wasSkipped = event.GetSkipped();