mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-22 12:39:29 +02:00
lcl: implements TDBMemo.KeyDown as in TDBEdit. Issue #19709
git-svn-id: trunk@35123 -
This commit is contained in:
parent
00193971b4
commit
0ed61b0702
@ -843,6 +843,7 @@ Type
|
||||
procedure Notification(AComponent: TComponent; Operation: TOperation); override;
|
||||
procedure UpdateData(Sender: TObject);
|
||||
procedure Change; override;
|
||||
procedure KeyDown(var Key: Word; Shift: TShiftState); override;
|
||||
procedure KeyPress(var Key:Char); override;
|
||||
procedure WndProc(var AMessage : TLMessage); override;
|
||||
class procedure WSRegisterClass; override;
|
||||
|
@ -138,6 +138,21 @@ begin
|
||||
inherited Change;
|
||||
end;
|
||||
|
||||
procedure TDBMemo.KeyDown(var Key: Word; Shift: TShiftState);
|
||||
begin
|
||||
inherited KeyDown(Key, Shift);
|
||||
if Key=VK_ESCAPE then begin
|
||||
//cancel out of editing by reset on esc
|
||||
FDataLink.Reset;
|
||||
SelectAll;
|
||||
Key := VK_UNKNOWN;
|
||||
end else
|
||||
if Key in [VK_DELETE, VK_BACK] then begin
|
||||
if not FDataLink.Edit then
|
||||
Key := VK_UNKNOWN;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TDBMemo.KeyPress(var Key: Char);
|
||||
function CheckValidChar: boolean;
|
||||
begin
|
||||
|
Loading…
Reference in New Issue
Block a user