From 0a856f043dbc0532fb95209f46e7bd4f44653e30 Mon Sep 17 00:00:00 2001 From: Michael Bedward Date: Wed, 21 Jun 2000 07:47:41 +0000 Subject: [PATCH] If grid cursor is at the bottom of a column a return key press will now save the editor value and hide the editor. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_2_BRANCH@7621 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/generic/grid.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/generic/grid.cpp b/src/generic/grid.cpp index c60fcffc49..54cbb0fa17 100644 --- a/src/generic/grid.cpp +++ b/src/generic/grid.cpp @@ -5268,7 +5268,16 @@ void wxGrid::OnKeyDown( wxKeyEvent& event ) } else { - MoveCursorDown( event.ShiftDown() ); + if ( GetGridCursorRow() < GetNumberRows()-1 ) + { + MoveCursorDown( event.ShiftDown() ); + } + else + { + // at the bottom of a column + HideCellEditControl(); + SaveEditControlValue(); + } } break;