Make default keyboard handling available in wxVarScrollHelperEvtHandler too.

Factor out the keyboard handling code in wxAnyScrollHelperBase allowing its
reuse in wxVarScrollHelperEvtHandler.

Now wxVarScrollHelperBase handles cursor keys in a sane way by default
too and also allows disabling their handling, just as wxScrolledWindow.

See #15357.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74815 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2013-09-15 00:15:17 +00:00
parent dc2513650d
commit 4706252347
3 changed files with 28 additions and 17 deletions

View File

@@ -142,6 +142,16 @@ bool wxVarScrollHelperEvtHandler::ProcessEvent(wxEvent& event)
m_scrollHelper->HandleOnMouseWheel((wxMouseEvent &)event);
}
#endif // wxUSE_MOUSEWHEEL
else if ( evType == wxEVT_CHAR &&
(m_scrollHelper->GetOrientation() == wxVERTICAL) )
{
m_scrollHelper->HandleOnChar((wxKeyEvent &)event);
if ( !event.GetSkipped() )
{
processed = true;
wasSkipped = false;
}
}
event.Skip(wasSkipped);