LCL, grids: pass the pressed key to the editor only if it came from the grid, this should prevent entering in a loop frezzing the program if the key was typed in the editor

git-svn-id: trunk@45276 -
This commit is contained in:
jesus 2014-06-01 01:46:15 +00:00
parent 164e4b9b9f
commit c3d5df753b

View File

@ -6804,17 +6804,19 @@ end;
procedure TCustomGrid.KeyPress(var Key: char);
begin
inherited KeyPress(Key);
if not EditorMode and EditingAllowed(FCol) then begin
if (Key=#13) then begin
SelectEditor;
EditorShow(True);
Key := #0;
end else
if (Key in [^H, #32..#255]) then begin
EditorShowChar(Key);
Key := #0;
if not EditorKey then
// we are interested in these keys only if they came from the grid
if not EditorMode and EditingAllowed(FCol) then begin
if (Key=#13) then begin
SelectEditor;
EditorShow(True);
Key := #0;
end else
if (Key in [^H, #32..#255]) then begin
EditorShowChar(Key);
Key := #0;
end;
end;
end;
end;
{ Convert a fisical Mouse coordinate into fisical a cell coordinate }
@ -7763,7 +7765,7 @@ begin
KeyPress(Key); // grid must get all keypresses, even if they are from the editor
{$ifdef dbgGrid}DebugLn('Grid.EditorKeyPress: inter Key=',PrintKey);{$Endif}
case Key of
^C,^V,^X:;
#0, ^C,^V,^X:;
^M:
begin