Don't process events handled in user code in generic scrolling code.
Undo the change introduced, probably accidentally, by r11369 (12 years ago) and skip the default handling of all events except wxEVT_SIZE and wxEVT_PAINT, which are special for the reasons explained in the comments in the code, if the user code has already handled the event. This allows to customize scrolling by selectively handling some scrolling events only and generally makes sense. Closes #15684. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@75252 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -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();
|
||||
|
Reference in New Issue
Block a user