From 56dade3c4d9b09f8bd290daf31a6b635aede029a Mon Sep 17 00:00:00 2001 From: Ron Lee Date: Wed, 26 Jan 2000 23:43:23 +0000 Subject: [PATCH] test for disabled scroll directions in kbd handler git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@5694 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/generic/scrolwin.cpp | 33 +++++++++++++++++++++------------ 1 file changed, 21 insertions(+), 12 deletions(-) diff --git a/src/generic/scrolwin.cpp b/src/generic/scrolwin.cpp index 4b57d21f4d..6370bbb356 100644 --- a/src/generic/scrolwin.cpp +++ b/src/generic/scrolwin.cpp @@ -619,25 +619,34 @@ void wxScrolledWindow::OnPaint(wxPaintEvent& WXUNUSED(event)) // this they always have the priority void wxScrolledWindow::OnChar(wxKeyEvent& event) { - if ( !m_xScrollPixelsPerLine || !m_yScrollPixelsPerLine ) - { - // stop now - no scroll line size - event.Skip(); - - return; - } - int stx, sty, // view origin szx, szy, // view size (total) clix, cliy; // view size (on screen) ViewStart(&stx, &sty); GetClientSize(&clix, &cliy); - clix /= m_xScrollPixelsPerLine; - cliy /= m_yScrollPixelsPerLine; GetVirtualSize(&szx, &szy); - szx /= m_xScrollPixelsPerLine; - szy /= m_yScrollPixelsPerLine; + + if( m_xScrollPixelsPerLine ) + { + clix /= m_xScrollPixelsPerLine; + szx /= m_xScrollPixelsPerLine; + } + else + { + clix = 0; + szx = -1; + } + if( m_yScrollPixelsPerLine ) + { + cliy /= m_yScrollPixelsPerLine; + szy /= m_yScrollPixelsPerLine; + } + else + { + cliy = 0; + szy = -1; + } switch ( event.KeyCode() ) { -- 2.45.2