MaskEdit: when user presses Escape, don't "eat" the key if there is nothing to reset.

(Delphi compatibility). Partially resolves issue #0023936.

git-svn-id: trunk@40379 -
This commit is contained in:
bart 2013-02-24 00:09:38 +00:00
parent 1c5712de23
commit 44caf00ceb

View File

@ -1579,7 +1579,7 @@ procedure TCustomMaskEdit.Reset;
begin begin
if IsMasked and (not ReadOnly) then if IsMasked and (not ReadOnly) then
begin begin
SetinheritedText(FTextOnEnter); SetInheritedText(FTextOnEnter);
end; end;
end; end;
@ -1659,9 +1659,12 @@ begin
//Escape Key //Escape Key
if (Key = VK_ESCAPE) and (Shift = []) then if (Key = VK_ESCAPE) and (Shift = []) then
begin begin
Reset; if ((inherited Text) <> FTextOnEnter) then
Key := 0; begin
Exit; Reset;
Key := 0;
Exit;
end;
end; end;
//Handle clipboard and delete/backspace keys //Handle clipboard and delete/backspace keys
if (Key = VK_DELETE) then if (Key = VK_DELETE) then