mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-11 13:28:04 +02:00
MaskEdit: do replace SpaceChar with #32 in FormatMaskText.
git-svn-id: trunk@52206 -
This commit is contained in:
parent
ada5db9ce2
commit
16b35167c9
@ -226,6 +226,7 @@ const
|
||||
procedure RealSetText(const AValue: TCaption); override;
|
||||
function RealGetText: TCaption; override;
|
||||
Function GetTextWithoutMask(Value: TCaption) : TCaption;
|
||||
function GetTextWithoutSpaceChar(Value: TCaption) : TCaption;
|
||||
Procedure SetTextApplyMask(Value: TCaption);
|
||||
function GetEditText: string; virtual;
|
||||
procedure SetEditText(const AValue: string);
|
||||
@ -415,8 +416,9 @@ begin
|
||||
if CME.IsMasked then
|
||||
begin
|
||||
Result := CME.ApplyMaskToText(Value);
|
||||
//Delphi 7 leaves in the mask regardless of the "MaskSave" value in the specified EditMask
|
||||
//Result := CME.GetTextWithoutMask(Result);
|
||||
//Delphi 7 leaves in the mask regardless of the "MaskSave" value in the specified EditMaske
|
||||
//but SpaceChar must be replaced by #32
|
||||
Result := CME.GetTextWithoutSpaceChar(Result);
|
||||
end
|
||||
else
|
||||
Result := Value;
|
||||
@ -1560,6 +1562,26 @@ Begin
|
||||
Result := S;
|
||||
End;
|
||||
|
||||
{
|
||||
Replace al FSPaceChars with #32
|
||||
Leave all mask literals in place
|
||||
Needed by FormatMaskText
|
||||
}
|
||||
function TCustomMaskEdit.GetTextWithoutSpaceChar(Value: TCaption): TCaption;
|
||||
var
|
||||
i: Integer;
|
||||
Begin
|
||||
Result := StringReplace(Value, FSpaceChar, #32, [rfReplaceAll]);
|
||||
//FSpaceChar can be used as a literal in the mask, so put it back
|
||||
for i := 1 to FMaskLength do
|
||||
begin
|
||||
if IsLiteral(FMask[i]) and (FMask[i] = FSpaceChar) then
|
||||
begin
|
||||
SetCodePoint(Result, i, FSpaceChar);
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
|
||||
// Respond to Text Changed message
|
||||
procedure TCustomMaskEdit.TextChanged;
|
||||
|
Loading…
Reference in New Issue
Block a user