Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Patch available] bgracontrols cannot compile against LCL trunk #226

Open
dokkie8844 opened this issue Feb 17, 2025 · 0 comments
Open

[Patch available] bgracontrols cannot compile against LCL trunk #226

dokkie8844 opened this issue Feb 17, 2025 · 0 comments

Comments

@dokkie8844
Copy link

Since about two weeks, the bgracontrols package cannot be compiled anymore against LCL trunk. The reason for this is that several deprecated functions were removed from the LCL, but are still used by bgracontrols:

LCL Remove OffsetRect:

(this was just a call to the Types.OffsetRect function and in that sense redundant)
https://gitlab.com/freepascal.org/lazarus/lazarus/-/commit/476da882fa0bc48e411822358f56353f4b9d3d20?page=2#f8c1f4e737095e4972d72ad0e5c6fa2e2c114d0b

LCL Remove FreeThenNil:

(this was deprecated, use LazUtilities.FreeThenNil instead)
https://gitlab.com/freepascal.org/lazarus/lazarus/-/commit/476da882fa0bc48e411822358f56353f4b9d3d20?page=2#44e1506a2432d5f9f804f40021c9dc16d70edabc

LCL Remove GetImageIndex / LoadImage:

(this was deprecated, use the other overload instead)
https://gitlab.com/freepascal.org/lazarus/lazarus/-/commit/fddb4de9bcdfc5face742cf2bdf606de5d882d08#d93520908061a62daa1d4d6bccd908f1e40102a1

Solution

The solution is to use the new functions instead.

bcstylesform.pas

This unit used the old GetImageIndex() and LoadImage() functions.

393c393
<   function _LoadImage(AIdx: Integer; const AName: String): Integer;
---
>   function _LoadImage(AImgSize: Integer; const AName: String): Integer;
395c395
<     Result := IDEImages.GetImageIndex(AIdx,AName);
---
>     Result := IDEImages.GetImageIndex(AName,AImgSize);
397c397
<       Result := IDEImages.LoadImage(AIdx,AName);
---
>       Result := IDEImages.LoadImage(AName,AImgSize);

bcbutton.pas

This unit uses FreeThenNil(), which is now only available in the LazUtilities unit.
Alternative solution: Replace FreeThenNil() by the standard FreeAndNil().

31c31,32
<   Classes, types, {$IFDEF FPC}LCLType, LResources, {$ENDIF} Controls, Dialogs,
---
>   Classes, types, {$IFDEF FPC}LCLType, LResources, LazUtilities, {$ENDIF}
>   Controls, Dialogs,

bcbuttonfocus.pas

This unit uses FreeThenNil(), which is now only available in the LazUtilities unit.
Alternative solution: Replace FreeThenNil() by the standard FreeAndNil().

29c29,30
<   Classes, {$IFDEF FPC}LCLType, LResources, LMessages,{$ENDIF} Controls, Dialogs,
---
>   Classes, {$IFDEF FPC}LCLType, LResources, LMessages, LazUtilities,{$ENDIF}
>   Controls, Dialogs,

bgraspriteanimation.pas

This unit uses OffsetRect, which is now only available in the Types unit.

25c25
<   {$IFNDEF FPC}Types, BGRAGraphics, GraphType, FPImage, {$ENDIF}
---
>   Types, {$IFNDEF FPC}BGRAGraphics, GraphType, FPImage, {$ENDIF}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant