lcl: implements TDBMemo.KeyDown as in TDBEdit. Issue #19709

git-svn-id: trunk@35123 -
This commit is contained in:
blikblum 2012-02-04 15:19:30 +00:00
parent 00193971b4
commit 0ed61b0702
2 changed files with 16 additions and 0 deletions

View File

@ -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;

View File

@ -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