From fbb7185e569b3a978ffcc5863a00dcac84f1f5ca Mon Sep 17 00:00:00 2001 From: paul Date: Mon, 12 Jan 2009 02:59:45 +0000 Subject: [PATCH] lcl: apply patch of Bart Broersma for bug "Entering a key not allowed by the EditMask in a TMaskEdit will clear the current key" (mantis #0012957) git-svn-id: trunk@18261 - --- lcl/maskedit.pp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lcl/maskedit.pp b/lcl/maskedit.pp index 4c9d745a0d..9bb36af92d 100644 --- a/lcl/maskedit.pp +++ b/lcl/maskedit.pp @@ -777,12 +777,16 @@ Var begin if CanInsertChar(FCursorPos + 1, Ch) then begin + DeleteChars(True); S := Inherited Text; S[FCursorPos + 1] := Ch; CurrentText := S; SetInheritedText(S); SelectNextChar; - end; + end + else + //If we have a selcetion (> 1) then Delete the selected text: Delphi compatibility + if HasExtSelection then DeleteSelected; end; @@ -1390,7 +1394,7 @@ begin // Insert a char if (Key In [#32..#255]) then begin - DeleteSelected; + //DeleteSelected; InsertChar(Key); //TDBEdit needs the value of Key to decide if Datasource is in Edit state //Key:= #0;