Grids: Do not move to another cell when user presses Left/Right in editor. Issue #29084

git-svn-id: branches/fixes_1_6@50634 -
This commit is contained in:
mattias 2015-12-05 11:30:16 +00:00
parent 1de06d1f01
commit 77d0809361
2 changed files with 20 additions and 9 deletions

View File

@ -6897,15 +6897,23 @@ begin
end else
TabCheckEditorKey;
VK_LEFT:
if Relaxed then
MoveSel(True, -cBidiMove[UseRightToLeftAlignment], 0)
else
MoveSel(True, 0,-1);
//Don't move to another cell is user is editing
if not FEditorKey then
begin
if Relaxed then
MoveSel(True, -cBidiMove[UseRightToLeftAlignment], 0)
else
MoveSel(True, 0,-1);
end;
VK_RIGHT:
if Relaxed then
MoveSel(True, cBidiMove[UseRightToLeftAlignment], 0)
else
MoveSel(True, 0, 1);
//Don't move to another cell is user is editing
if not FEditorKey then
begin
if Relaxed then
MoveSel(True, cBidiMove[UseRightToLeftAlignment], 0)
else
MoveSel(True, 0, 1);
end;
VK_UP:
MoveSel(True, 0, -1);
VK_DOWN:

View File

@ -1190,7 +1190,10 @@ begin
end;
Result:=inherited GetDefaultEditor(Column);
//Need this to be able to intercept VK_Delete in the editor
EditorOptions := EditorOptions or EO_HOOKKEYDOWN;
if (KeyDelete in KeyOptions) then
EditorOptions := EditorOptions or EO_HOOKKEYDOWN
else
EditorOptions := EditorOptions and (not EO_HOOKKEYDOWN);
if Column=1 then
begin
ItemProp := nil;