From 8034c36f534042e90a18933335a82e274aa46a07 Mon Sep 17 00:00:00 2001 From: Michael Bedward Date: Wed, 21 Jun 2000 09:06:27 +0000 Subject: [PATCH] TAB key press at left or right of grid now saves editor value and hides editor git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_2_BRANCH@7623 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/generic/grid.cpp | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/src/generic/grid.cpp b/src/generic/grid.cpp index 54cbb0fa17..c00a030efb 100644 --- a/src/generic/grid.cpp +++ b/src/generic/grid.cpp @@ -5287,9 +5287,31 @@ void wxGrid::OnKeyDown( wxKeyEvent& event ) case WXK_TAB: if (event.ShiftDown()) - MoveCursorLeft( FALSE ); + { + if ( GetGridCursorCol() > 0 ) + { + MoveCursorLeft( FALSE ); + } + else + { + // at left of grid + HideCellEditControl(); + SaveEditControlValue(); + } + } else - MoveCursorRight( FALSE ); + { + if ( GetGridCursorCol() > 0 ) + { + MoveCursorRight( FALSE ); + } + else + { + // at right of grid + HideCellEditControl(); + SaveEditControlValue(); + } + } break; case WXK_HOME: