more backwards compatible kbd handling in wxScrolledWindow

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@5680 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2000-01-26 16:42:45 +00:00
parent 50af7fa9f2
commit 438e3558ad
2 changed files with 7 additions and 4 deletions

View 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);

View 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 )
{