From: Vadim Zeitlin Date: Mon, 12 Jul 2010 22:50:18 +0000 (+0000) Subject: Make Home and End keys work as expected in wxGrid. X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/ad178a657eee61dc43a516b8aaf4ae2499302a24 Make Home and End keys work as expected in wxGrid. Go to the first/last cell of the current row when they're pressed instead of starting the editor. Closes #12222. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64917 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/generic/grid.cpp b/src/generic/grid.cpp index 798ffce16e..106a57a06e 100644 --- a/src/generic/grid.cpp +++ b/src/generic/grid.cpp @@ -4669,25 +4669,15 @@ void wxGrid::OnKeyDown( wxKeyEvent& event ) break; case WXK_HOME: - if ( event.ControlDown() ) - { - GoToCell(0, 0); - } - else - { - event.Skip(); - } + GoToCell(event.ControlDown() ? 0 + : m_currentCellCoords.GetRow(), + 0); break; case WXK_END: - if ( event.ControlDown() ) - { - GoToCell(m_numRows - 1, m_numCols - 1); - } - else - { - event.Skip(); - } + GoToCell(event.ControlDown() ? m_numRows - 1 + : m_currentCellCoords.GetRow(), + m_numCols - 1); break; case WXK_PAGEUP: