]> git.saurik.com Git - wxWidgets.git/commitdiff
more backwards compatible kbd handling in wxScrolledWindow
authorVadim Zeitlin <vadim@wxwidgets.org>
Wed, 26 Jan 2000 16:42:45 +0000 (16:42 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Wed, 26 Jan 2000 16:42:45 +0000 (16:42 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@5680 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/generic/scrolwin.h
src/generic/scrolwin.cpp

index 4ff17c5ad9dcb7112030e7794e15824b118a61ac..9af106c0710a6d5fad792f82a5bf1536665f01fb 100644 (file)
@@ -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);
index f029987f68b743970704168fe2e019feac48c072..4b57d21f4de82878af45e5c779dfbb88a9f930eb 100644 (file)
@@ -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 )
     {