From 44caf00ceb2ce45c52d17585ea7979c270a34907 Mon Sep 17 00:00:00 2001 From: bart <9132501-flyingsheep@users.noreply.gitlab.com> Date: Sun, 24 Feb 2013 00:09:38 +0000 Subject: [PATCH] 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 - --- lcl/maskedit.pp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/lcl/maskedit.pp b/lcl/maskedit.pp index 20f3424d85..068711c54e 100644 --- a/lcl/maskedit.pp +++ b/lcl/maskedit.pp @@ -1579,7 +1579,7 @@ procedure TCustomMaskEdit.Reset; begin if IsMasked and (not ReadOnly) then begin - SetinheritedText(FTextOnEnter); + SetInheritedText(FTextOnEnter); end; end; @@ -1659,9 +1659,12 @@ begin //Escape Key if (Key = VK_ESCAPE) and (Shift = []) then begin - Reset; - Key := 0; - Exit; + if ((inherited Text) <> FTextOnEnter) then + begin + Reset; + Key := 0; + Exit; + end; end; //Handle clipboard and delete/backspace keys if (Key = VK_DELETE) then