LCL: fix grids UTF8Keypress, issue #38666

This commit is contained in:
Jesus Reyes A 2021-07-30 14:49:25 -05:00
parent 9f7df59b14
commit 3ae2076292

View File

@ -1314,6 +1314,7 @@ type
function EditorByStyle(Style: TColumnButtonStyle): TWinControl; virtual;
procedure EditorKeyDown(Sender: TObject; var Key:Word; Shift:TShiftState);
procedure EditorKeyPress(Sender: TObject; var Key: Char);
procedure EditorUTF8KeyPress(Sender: TObject; var UTF8Key: TUTF8Char);
procedure EditorKeyUp(Sender: TObject; var key:Word; shift:TShiftState);
procedure EditorTextChanged(const aCol,aRow: Integer; const aText:string); virtual;
@ -5698,6 +5699,7 @@ begin
end;
if FEditorOptions and EO_HOOKKEYPRESS = EO_HOOKKEYPRESS then begin
FEditor.OnKeyPress := @EditorKeyPress;
FEditor.OnUTF8KeyPress := @EditorUTF8KeyPress;
end;
if FEditorOptions and EO_HOOKKEYUP = EO_HOOKKEYUP then begin
FEditor.OnKeyUp := @EditorKeyUp;
@ -8758,6 +8760,14 @@ begin
{$ifdef dbgGrid}DebugLn('Grid.EditorKeyPress: END Key=',PrintKey);{$Endif}
end;
procedure TCustomGrid.EditorUTF8KeyPress(Sender: TObject; var UTF8Key: TUTF8Char
);
begin
FEditorKey := True;
UTF8KeyPress(UTF8Key);
FEditorKey := false;
end;
procedure TCustomGrid.EditorKeyUp(Sender: TObject; var key: Word;
shift: TShiftState);
begin