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 -
This commit is contained in:
paul 2009-01-12 02:59:45 +00:00
parent 0719f81d18
commit fbb7185e56

View File

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