mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-05-29 05:02:46 +02:00
lcl: use DefaultFormatSettings to prevent deprecated message generation
git-svn-id: trunk@28588 -
This commit is contained in:
parent
fcc7ed3436
commit
57daf59d6e
@ -254,7 +254,7 @@ begin
|
|||||||
DateToStr(CalendarMinDate), DateToStr(CalendarMaxDate)]);
|
DateToStr(CalendarMinDate), DateToStr(CalendarMaxDate)]);
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
FDate:=AValue;
|
FDate:=AValue;
|
||||||
FDateAsString:=FormatDateTime(ShortDateFormat,FDate);
|
FDateAsString:=FormatDateTime(DefaultFormatSettings.ShortDateFormat,FDate);
|
||||||
{$IFDEF VerboseCalenderSetDate}
|
{$IFDEF VerboseCalenderSetDate}
|
||||||
DebugLn('TCustomCalendar.SetDateTime FDate=',DateToStr(FDate),' FDateAsString=',FDateAsString,' ShortDateFormat=',ShortDateFormat);
|
DebugLn('TCustomCalendar.SetDateTime FDate=',DateToStr(FDate),' FDateAsString=',FDateAsString,' ShortDateFormat=',ShortDateFormat);
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
@ -266,7 +266,7 @@ begin
|
|||||||
if HandleAllocated and ([csLoading,csDestroying]*ComponentState=[]) then
|
if HandleAllocated and ([csLoading,csDestroying]*ComponentState=[]) then
|
||||||
begin
|
begin
|
||||||
FDate := TWSCustomCalendarClass(WidgetSetClass).GetDateTime(Self);
|
FDate := TWSCustomCalendarClass(WidgetSetClass).GetDateTime(Self);
|
||||||
FDateAsString := FormatDateTime(ShortDateFormat,FDate);
|
FDateAsString := FormatDateTime(DefaultFormatSettings.ShortDateFormat,FDate);
|
||||||
{$IFDEF VerboseCalenderSetDate}
|
{$IFDEF VerboseCalenderSetDate}
|
||||||
DebugLn('TCustomCalendar.GetProps A ',DateToStr(FDate),' ',FDateAsString);
|
DebugLn('TCustomCalendar.GetProps A ',DateToStr(FDate),' ',FDateAsString);
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
|
@ -954,7 +954,7 @@ end;
|
|||||||
|
|
||||||
procedure TDateEdit.DateFormatChanged;
|
procedure TDateEdit.DateFormatChanged;
|
||||||
begin
|
begin
|
||||||
FDateFormat := ShortDateFormat;
|
FDateFormat := DefaultFormatSettings.ShortDateFormat;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TDateEdit.GetDateFormat: string;
|
function TDateEdit.GetDateFormat: string;
|
||||||
@ -1034,13 +1034,13 @@ Var
|
|||||||
|
|
||||||
begin
|
begin
|
||||||
Result:=Def;
|
Result:=Def;
|
||||||
P:=Pos(DateSeparator,S);
|
P:=Pos(DefaultFormatSettings.DateSeparator,S);
|
||||||
If (P=0) then
|
If (P=0) then
|
||||||
Exit;
|
Exit;
|
||||||
N1:=StrToIntDef(Copy(S,1,P-1),-1);
|
N1:=StrToIntDef(Copy(S,1,P-1),-1);
|
||||||
If (N1=-1) then Exit;
|
If (N1=-1) then Exit;
|
||||||
Delete(S,1,P);
|
Delete(S,1,P);
|
||||||
P:=Pos(DateSeparator,S);
|
P:=Pos(DefaultFormatSettings.DateSeparator,S);
|
||||||
If (P=0) then
|
If (P=0) then
|
||||||
Exit;
|
Exit;
|
||||||
N2:=StrToIntDef(Copy(S,1,P-1),-1);
|
N2:=StrToIntDef(Copy(S,1,P-1),-1);
|
||||||
|
@ -545,7 +545,7 @@ begin
|
|||||||
if Kind in [cbNum0..cbNum9] then
|
if Kind in [cbNum0..cbNum9] then
|
||||||
Caption:=IntToStr(Tag)
|
Caption:=IntToStr(Tag)
|
||||||
else if Kind = cbDcm then
|
else if Kind = cbDcm then
|
||||||
Caption:=DecimalSeparator
|
Caption:=DefaultFormatSettings.DecimalSeparator
|
||||||
else if Kind in [cbSgn..cbMC] then
|
else if Kind in [cbSgn..cbMC] then
|
||||||
Caption:=BtnCaptions[Kind];
|
Caption:=BtnCaptions[Kind];
|
||||||
Left:=BtnPos[ALayout, Kind].X;
|
Left:=BtnPos[ALayout, Kind].X;
|
||||||
@ -792,11 +792,11 @@ begin
|
|||||||
Key:=#0;
|
Key:=#0;
|
||||||
if Assigned(FOnCalcKey) then
|
if Assigned(FOnCalcKey) then
|
||||||
FOnCalcKey(Self, Key);
|
FOnCalcKey(Self, Key);
|
||||||
if Key in [DecimalSeparator, '.', ','] then
|
if Key in [DefaultFormatSettings.DecimalSeparator, '.', ','] then
|
||||||
begin
|
begin
|
||||||
CheckFirst;
|
CheckFirst;
|
||||||
if Pos(DecimalSeparator, FText) = 0 then
|
if Pos(DefaultFormatSettings.DecimalSeparator, FText) = 0 then
|
||||||
SetCalcText(FText + DecimalSeparator);
|
SetCalcText(FText + DefaultFormatSettings.DecimalSeparator);
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
case Key of
|
case Key of
|
||||||
@ -903,7 +903,7 @@ var
|
|||||||
I: Integer;
|
I: Integer;
|
||||||
BtnTag: Longint;
|
BtnTag: Longint;
|
||||||
begin
|
begin
|
||||||
if Key in [DecimalSeparator, '.', ','] then
|
if Key in [DefaultFormatSettings.DecimalSeparator, '.', ','] then
|
||||||
Key:='.'
|
Key:='.'
|
||||||
else if Key = #13 then
|
else if Key = #13 then
|
||||||
Key:='='
|
Key:='='
|
||||||
@ -929,7 +929,7 @@ begin
|
|||||||
case TCalcButton(Sender).Kind of
|
case TCalcButton(Sender).Kind of
|
||||||
cbNum0..cbNum9: CalcKey(Char(TComponent(Sender).Tag + Ord('0')));
|
cbNum0..cbNum9: CalcKey(Char(TComponent(Sender).Tag + Ord('0')));
|
||||||
cbSgn: CalcKey('_');
|
cbSgn: CalcKey('_');
|
||||||
cbDcm: CalcKey(DecimalSeparator);
|
cbDcm: CalcKey(DefaultFormatSettings.DecimalSeparator);
|
||||||
cbDiv: CalcKey('/');
|
cbDiv: CalcKey('/');
|
||||||
cbMul: CalcKey('*');
|
cbMul: CalcKey('*');
|
||||||
cbSub: CalcKey('-');
|
cbSub: CalcKey('-');
|
||||||
|
@ -418,7 +418,7 @@ begin
|
|||||||
str := Trim(Associate.Caption);
|
str := Trim(Associate.Caption);
|
||||||
InvalidNumber := str = '';
|
InvalidNumber := str = '';
|
||||||
For I := Length(str) downto 1 do
|
For I := Length(str) downto 1 do
|
||||||
if str[I] = ThousandSeparator then
|
if str[I] = DefaultFormatSettings.ThousandSeparator then
|
||||||
Delete(Str,I,1)
|
Delete(Str,I,1)
|
||||||
else if str[I] in ['0'..'9'] then
|
else if str[I] in ['0'..'9'] then
|
||||||
else begin
|
else begin
|
||||||
|
@ -111,9 +111,9 @@ procedure TCustomFloatSpinEdit.KeyPress(var Key: char);
|
|||||||
}
|
}
|
||||||
begin
|
begin
|
||||||
inherited KeyPress(Key);
|
inherited KeyPress(Key);
|
||||||
if (Key in ['.',',']) then Key := Decimalseparator;
|
if (Key in ['.',',']) then Key := DefaultFormatSettings.Decimalseparator;
|
||||||
if not (Key in ['0'..'9',DecimalSeparator,'+','-',#8,#9]) then Key := #0;
|
if not (Key in ['0'..'9', DefaultFormatSettings.DecimalSeparator,'+','-',#8,#9]) then Key := #0;
|
||||||
if (Key = DecimalSeparator) and (FDecimals = 0) then Key := #0;
|
if (Key = DefaultFormatSettings.DecimalSeparator) and (FDecimals = 0) then Key := #0;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
class function TCustomFloatSpinEdit.GetControlClassDefaultSize: TSize;
|
class function TCustomFloatSpinEdit.GetControlClassDefaultSize: TSize;
|
||||||
|
@ -2533,15 +2533,15 @@ begin
|
|||||||
Input.Read(Signature[1], length(Signature));
|
Input.Read(Signature[1], length(Signature));
|
||||||
if Signature<>FilerSignature then
|
if Signature<>FilerSignature then
|
||||||
raise EReadError.Create('Illegal stream image' {###SInvalidImage});
|
raise EReadError.Create('Illegal stream image' {###SInvalidImage});
|
||||||
OldDecimalSeparator:=DecimalSeparator;
|
OldDecimalSeparator:=DefaultFormatSettings.DecimalSeparator;
|
||||||
DecimalSeparator:='.';
|
DefaultFormatSettings.DecimalSeparator:='.';
|
||||||
OldThousandSeparator:=ThousandSeparator;
|
OldThousandSeparator:=DefaultFormatSettings.ThousandSeparator;
|
||||||
ThousandSeparator:=',';
|
DefaultFormatSettings.ThousandSeparator:=',';
|
||||||
try
|
try
|
||||||
ReadObject('');
|
ReadObject('');
|
||||||
finally
|
finally
|
||||||
DecimalSeparator:=OldDecimalSeparator;
|
DefaultFormatSettings.DecimalSeparator:=OldDecimalSeparator;
|
||||||
ThousandSeparator:=OldThousandSeparator;
|
DefaultFormatSettings.ThousandSeparator:=OldThousandSeparator;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -2965,17 +2965,17 @@ begin
|
|||||||
Links.Sort(true);
|
Links.Sort(true);
|
||||||
end;
|
end;
|
||||||
parser := {$IFDEF DisableWindowsUnicodeSupport}TParser{$ELSE}TUTF8Parser{$ENDIF}.Create(Input);
|
parser := {$IFDEF DisableWindowsUnicodeSupport}TParser{$ELSE}TUTF8Parser{$ENDIF}.Create(Input);
|
||||||
OldDecimalSeparator:=DecimalSeparator;
|
OldDecimalSeparator:=DefaultFormatSettings.DecimalSeparator;
|
||||||
DecimalSeparator:='.';
|
DefaultFormatSettings.DecimalSeparator:='.';
|
||||||
OldThousandSeparator:=ThousandSeparator;
|
OldThousandSeparator:=DefaultFormatSettings.ThousandSeparator;
|
||||||
ThousandSeparator:=',';
|
DefaultFormatSettings.ThousandSeparator:=',';
|
||||||
try
|
try
|
||||||
Output.Write(FilerSignature[1], length(FilerSignature));
|
Output.Write(FilerSignature[1], length(FilerSignature));
|
||||||
ProcessObject;
|
ProcessObject;
|
||||||
finally
|
finally
|
||||||
parser.Free;
|
parser.Free;
|
||||||
DecimalSeparator:=OldDecimalSeparator;
|
DefaultFormatSettings.DecimalSeparator:=OldDecimalSeparator;
|
||||||
ThousandSeparator:=OldThousandSeparator;
|
DefaultFormatSettings.ThousandSeparator:=OldThousandSeparator;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -3510,7 +3510,7 @@ begin
|
|||||||
DeletePos:=p;
|
DeletePos:=p;
|
||||||
while (DeletePos>1) and (Result[DeletePos]='0') do
|
while (DeletePos>1) and (Result[DeletePos]='0') do
|
||||||
Dec(DeletePos);
|
Dec(DeletePos);
|
||||||
if (DeletePos>0) and (Result[DeletePos]=DecimalSeparator) Then
|
if (DeletePos>0) and (Result[DeletePos]=DefaultFormatSettings.DecimalSeparator) Then
|
||||||
Dec(DeletePos);
|
Dec(DeletePos);
|
||||||
if (DeletePos<p) then
|
if (DeletePos<p) then
|
||||||
system.Delete(Result,DeletePos,p-DeletePos);
|
system.Delete(Result,DeletePos,p-DeletePos);
|
||||||
@ -3521,7 +3521,7 @@ begin
|
|||||||
P := Length(Result);
|
P := Length(Result);
|
||||||
While (P>0) and (Result[P] = '0') Do
|
While (P>0) and (Result[P] = '0') Do
|
||||||
Dec(P);
|
Dec(P);
|
||||||
If (P>0) and (Result[P]=DecimalSeparator) Then
|
If (P>0) and (Result[P]=DefaultFormatSettings.DecimalSeparator) Then
|
||||||
Dec(P);
|
Dec(P);
|
||||||
SetLength(Result, P);
|
SetLength(Result, P);
|
||||||
end;
|
end;
|
||||||
|
@ -904,8 +904,8 @@ begin
|
|||||||
Char_AllFixedUpCase : OK := Ch in [#32..#126]; //True;
|
Char_AllFixedUpCase : OK := Ch in [#32..#126]; //True;
|
||||||
Char_AllFixedDownCase : OK := Ch in [#32..#126]; //True;
|
Char_AllFixedDownCase : OK := Ch in [#32..#126]; //True;
|
||||||
{Char_Space : OK := Ch in [' ', '_']; //not Delphi compatible, see notes above}
|
{Char_Space : OK := Ch in [' ', '_']; //not Delphi compatible, see notes above}
|
||||||
Char_HourSeparator : OK := Ch in [TimeSeparator];
|
Char_HourSeparator : OK := Ch in [DefaultFormatSettings.TimeSeparator];
|
||||||
Char_DateSeparator : OK := Ch in [DateSeparator];
|
Char_DateSeparator : OK := Ch in [DefaultFormatSettings.DateSeparator];
|
||||||
else//it's a literal
|
else//it's a literal
|
||||||
begin
|
begin
|
||||||
OK := (Ch = FMask[Position]);
|
OK := (Ch = FMask[Position]);
|
||||||
@ -1003,8 +1003,8 @@ begin
|
|||||||
Char_AllFixedUpCase : Result := FSpaceChar; //'0';
|
Char_AllFixedUpCase : Result := FSpaceChar; //'0';
|
||||||
Char_AllFixedDownCase : Result := FSpaceChar; //'0';
|
Char_AllFixedDownCase : Result := FSpaceChar; //'0';
|
||||||
{Char_Space : Result := #32; //FSpaceChar?; //not Delphi compatible, see notes above}
|
{Char_Space : Result := #32; //FSpaceChar?; //not Delphi compatible, see notes above}
|
||||||
Char_HourSeparator : Result := TimeSeparator;
|
Char_HourSeparator : Result := DefaultFormatSettings.TimeSeparator;
|
||||||
Char_DateSeparator : Result := DateSeparator;
|
Char_DateSeparator : Result := DefaultFormatSettings.DateSeparator;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -1091,8 +1091,8 @@ Begin
|
|||||||
Char_AllFixedUpCase : Result := Ch in [#32..#126]; //True;
|
Char_AllFixedUpCase : Result := Ch in [#32..#126]; //True;
|
||||||
Char_AllFixedDownCase : Result := Ch in [#32..#126]; //True;
|
Char_AllFixedDownCase : Result := Ch in [#32..#126]; //True;
|
||||||
{Char_Space : Result := Ch in [' ', '_']; //not Delphi compatible, see notes above}
|
{Char_Space : Result := Ch in [' ', '_']; //not Delphi compatible, see notes above}
|
||||||
Char_HourSeparator : Result := Ch in [TimeSeparator];
|
Char_HourSeparator : Result := Ch in [DefaultFormatSettings.TimeSeparator];
|
||||||
Char_DateSeparator : Result := Ch in [DateSeparator];
|
Char_DateSeparator : Result := Ch in [DefaultFormatSettings.DateSeparator];
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user