From 025bbdb0d2aeacffba45be69273020a86b082cba Mon Sep 17 00:00:00 2001 From: alexs75 Date: Fri, 31 Jan 2025 19:57:37 +0000 Subject: [PATCH] RxFPC:fix compile after lazarus rev 476da882 git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@9613 8e941d3f-bd1b-0410-a28a-d453659cc2b4 --- components/rx/trunk/rxcontrols/rxclock.pas | 2 +- components/rx/trunk/rxcontrols/rxctrls.pas | 7 +-- .../rx/trunk/rxcontrols/rxinipropstorage.pas | 44 ++++++++++++++----- components/rx/trunk/rxdb/rxlookup.pas | 2 +- 4 files changed, 38 insertions(+), 17 deletions(-) diff --git a/components/rx/trunk/rxcontrols/rxclock.pas b/components/rx/trunk/rxcontrols/rxclock.pas index fdccc3c80..e72513438 100644 --- a/components/rx/trunk/rxcontrols/rxclock.pas +++ b/components/rx/trunk/rxcontrols/rxclock.pas @@ -179,7 +179,7 @@ type implementation -uses rxlclutils, RTLConsts, LCLIntf; +uses Types, rxlclutils, RTLConsts, LCLIntf; const Registered: Boolean = False; diff --git a/components/rx/trunk/rxcontrols/rxctrls.pas b/components/rx/trunk/rxcontrols/rxctrls.pas index d67a623f3..df1840197 100644 --- a/components/rx/trunk/rxcontrols/rxctrls.pas +++ b/components/rx/trunk/rxcontrols/rxctrls.pas @@ -821,8 +821,9 @@ type implementation -uses SysUtils, Dialogs, rxlclutils, Math, RxAppUtils, ImgList, +uses SysUtils, Types, Dialogs, rxlclutils, Math, RxAppUtils, ImgList, ActnList, InterfaceBase; + const Alignments: array [TAlignment] of Word = (DT_LEFT, DT_RIGHT, DT_CENTER); WordWraps: array[Boolean] of Word = (0, DT_WORDBREAK); @@ -2539,8 +2540,8 @@ begin RShadow := Rect; Color := SetTextColor(DC, ShadowColor); case ShadowPos of - spLeftTop: OffsetRect(RShadow, -ShadowSize, -ShadowSize); - spRightBottom: OffsetRect(RShadow, ShadowSize, ShadowSize); + spLeftTop: Types.OffsetRect(RShadow, -ShadowSize, -ShadowSize); + spRightBottom: Types.OffsetRect(RShadow, ShadowSize, ShadowSize); spLeftBottom: begin {OffsetRect(RText, ShadowSize, 0);} diff --git a/components/rx/trunk/rxcontrols/rxinipropstorage.pas b/components/rx/trunk/rxcontrols/rxinipropstorage.pas index 1dd13d123..65b17a5c4 100644 --- a/components/rx/trunk/rxcontrols/rxinipropstorage.pas +++ b/components/rx/trunk/rxcontrols/rxinipropstorage.pas @@ -106,33 +106,53 @@ begin inherited FinishPropertyList(List); end; +const + sWidth = '_WIDTH'; + sHeight = '_HEIGHT'; + function TRxIniPropStorage.DoReadString(const Section, Ident, DefaultValue: string): string; var S: String; ASize: LongInt; ASize1, PP: Integer; + R:SizeInt; + CC:SizeInt; begin PP:=0; Result := inherited DoReadString(Section, Ident, DefaultValue); {$IfNDef FIX_WIDTH_WIDE_STRING96} - S:=UpperCase(Ident); - if (Pos('_WIDTH', S) > 0) or (Pos('_HEIGHT', S) > 0) then + + if (Pos('_', Ident) > 0) then begin - if Assigned(Screen) then +// CompareStr + S:=UpperCase(Ident); + R:=Length(S); + + if R >= Length(sWidth) then + CC:=CompareChar(S[R-Length(sWidth)+1], sWidth[1], Length(sWidth)); + + if (CC<>0) and (R >= Length(sHeight)) then + CC:=CompareChar(S[R-Length(sHeight)+1], sHeight[1], Length(sHeight)); + + // if (Pos('_WIDTH', S) > 0) or (Pos('_HEIGHT', S) > 0) then + if CC=0 then begin - ASize:=StrToIntDef(Result, -1); - if ASize>-1 then + if Assigned(Screen) then begin - //ASize1 := MulDiv(ASize, Screen.PixelsPerInch, 96); - if Screen.PixelsPerInch <> 0 then + ASize:=StrToIntDef(Result, -1); + if ASize>-1 then begin - if Owner is TForm then - PP:=TForm(Owner).DesignTimePPI; - if PP>0 then + //ASize1 := MulDiv(ASize, Screen.PixelsPerInch, 96); + if Screen.PixelsPerInch <> 0 then begin - ASize1 := MulDiv(ASize, PP, Screen.PixelsPerInch); - Result := IntToStr(ASize1); + if Owner is TForm then + PP:=TForm(Owner).DesignTimePPI; + if PP>0 then + begin + ASize1 := MulDiv(ASize, PP, Screen.PixelsPerInch); + Result := IntToStr(ASize1); + end; end; end; end; diff --git a/components/rx/trunk/rxdb/rxlookup.pas b/components/rx/trunk/rxdb/rxlookup.pas index 9687e1d35..c837abe74 100644 --- a/components/rx/trunk/rxdb/rxlookup.pas +++ b/components/rx/trunk/rxdb/rxlookup.pas @@ -1926,7 +1926,7 @@ end; procedure TRxDBLookupCombo.OnInternalClosePopup(AResult: boolean); begin inherited OnInternalClosePopup(AResult); - if MouseEntered or FButton.MouseEntered then + if MouseInClient or FButton.MouseInClient then FStopClick:=true; end;