From: Vadim Zeitlin Date: Wed, 26 Jan 2000 16:42:45 +0000 (+0000) Subject: more backwards compatible kbd handling in wxScrolledWindow X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/438e3558adf77a68f56b6e4d30b359f8361facac more backwards compatible kbd handling in wxScrolledWindow git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@5680 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/include/wx/generic/scrolwin.h b/include/wx/generic/scrolwin.h index 4ff17c5ad9..9af106c071 100644 --- a/include/wx/generic/scrolwin.h +++ b/include/wx/generic/scrolwin.h @@ -123,7 +123,7 @@ public: void OnScroll(wxScrollWinEvent& event); void OnSize(wxSizeEvent& event); void OnPaint(wxPaintEvent& event); - void OnKeyDown(wxKeyEvent& event); + void OnChar(wxKeyEvent& event); // Calculate scroll increment virtual int CalcScrollInc(wxScrollWinEvent& event); diff --git a/src/generic/scrolwin.cpp b/src/generic/scrolwin.cpp index f029987f68..4b57d21f4d 100644 --- a/src/generic/scrolwin.cpp +++ b/src/generic/scrolwin.cpp @@ -58,7 +58,7 @@ BEGIN_EVENT_TABLE(wxScrolledWindow, wxPanel) EVT_SCROLLWIN(wxScrolledWindow::OnScroll) EVT_SIZE(wxScrolledWindow::OnSize) EVT_PAINT(wxScrolledWindow::OnPaint) - EVT_KEY_DOWN(wxScrolledWindow::OnKeyDown) + EVT_CHAR(wxScrolledWindow::OnChar) END_EVENT_TABLE() IMPLEMENT_DYNAMIC_CLASS(wxScrolledWindow, wxPanel) @@ -613,8 +613,11 @@ void wxScrolledWindow::OnPaint(wxPaintEvent& WXUNUSED(event)) OnDraw(dc); } -// kbd handling -void wxScrolledWindow::OnKeyDown(wxKeyEvent& event) +// kbd handling: notice that we use OnChar() and not OnKeyDown() for +// 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 wxScrolledWindow::OnChar(wxKeyEvent& event) { if ( !m_xScrollPixelsPerLine || !m_yScrollPixelsPerLine ) {