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:
@@ -326,6 +326,8 @@ wxAnyScrollHelperBase::wxAnyScrollHelperBase(wxWindow* win)
|
||||
|
||||
m_win = win;
|
||||
m_targetWindow = NULL;
|
||||
|
||||
m_kbdScrollingEnabled = true;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
@@ -347,8 +349,6 @@ wxScrollHelperBase::wxScrollHelperBase(wxWindow *win)
|
||||
m_xScrollingEnabled =
|
||||
m_yScrollingEnabled = true;
|
||||
|
||||
m_kbdScrollingEnabled = true;
|
||||
|
||||
m_scaleX =
|
||||
m_scaleY = 1.0;
|
||||
#if wxUSE_MOUSEWHEEL
|
||||
@@ -833,7 +833,7 @@ void wxAnyScrollHelperBase::HandleOnPaint(wxPaintEvent& WXUNUSED(event))
|
||||
// compatibility here - if we used OnKeyDown(), the programs which process
|
||||
// arrows themselves in their OnChar() would never get the message and like
|
||||
// this they always have the priority
|
||||
void wxScrollHelperBase::HandleOnChar(wxKeyEvent& event)
|
||||
void wxAnyScrollHelperBase::HandleOnChar(wxKeyEvent& event)
|
||||
{
|
||||
if ( !m_kbdScrollingEnabled )
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user