Recent

Author Topic: CustomDraw package compile error (lupa.bmp)  (Read 1232 times)

Mother10

  • Newbie
  • Posts: 4
CustomDraw package compile error (lupa.bmp)
« on: November 06, 2025, 01:23:47 pm »
Hi all,

I try to install the Customdraw package that comes with Lazarus 4.2.
But when i compile it seems to miss lupa.bmp (and another one)

Why?

Regards,
Tineke

wp

  • Hero Member
  • *****
  • Posts: 13267
Re: CustomDraw package compile error (lupa.bmp)
« Reply #1 on: November 06, 2025, 04:30:24 pm »
I checked installation of the CustomDrawn package in Laz 4.2 / fpc 3.2.2 / 64 bit / windows 11 and did not notice any issue. Please give more information about your operating system.
« Last Edit: November 06, 2025, 04:34:07 pm by wp »

atroesch

  • New Member
  • *
  • Posts: 15
Re: CustomDraw package compile error (lupa.bmp)
« Reply #2 on: November 06, 2025, 04:50:34 pm »
here also missing bmp

Laz 4.2 / fpc 3.2.2 / 64 bit / windows 11

C:\lazarus\components\customdrawn\examples\controls\cdcontrolstest.exe

compiles without error, but dosn´t run

Mother10

  • Newbie
  • Posts: 4
Re: CustomDraw package compile error (lupa.bmp)
« Reply #3 on: November 06, 2025, 05:28:14 pm »
Ah so sorry, I meant compiling the example of custom draw, not the package itself. Although compiling the package gave a lot of warnings. But I guessed they were not important as they are warnings.

My operating system:

Laz 4.2 / FPC 3.2.2 / x86_64-win64-win32/win64  On windows 11.

Error came in the statements:
lBmp.LoadFromFile('/usr/share/magnifier/lupa.bmp');
lBmp.LoadFromFile('/usr/share/magnifier/usplegal.bmp');

I tried looking in my user area, but it wasnt there either.

wp

  • Hero Member
  • *****
  • Posts: 13267
Re: CustomDraw package compile error (lupa.bmp)
« Reply #4 on: November 06, 2025, 05:51:48 pm »
Thanks, this is useful information. Looked at the sources of the sample project and found that the missing file "lupa.bmp" (as well as "usplegal.bmp") is used by unit toolbartest.pas in OnCreate handler of the form. Found these two files in https://sources.debian.org/src/vmg/3.7.1-7 from which I downloaded them into folder examples/controls of the CustomDrawn installation. Changed the OnCreate handler so that they can be found now:

Code: Pascal  [Select][+][-]
  1. procedure TFormToolBar.FormCreate(Sender: TObject);
  2. var
  3.   lBmp: TBitmap;
  4.   lItem: TCDToolBarItem;
  5. begin
  6.  
  7.   lToolBar := TCDToolBar.Create(Self);
  8.   lToolBar.Parent := Self;
  9.  
  10.   lBmp := TBitmap.Create;
  11.   lBmp.LoadFromFile('lupa.bmp');
  12.   lItem := lToolBar.AddItem(tikButton);
  13.   lItem.Image := lBmp;
  14.   lItem.Caption := 'Btn 1';
  15.  
  16.   lItem := lToolBar.AddItem(tikSeparator);
  17.  
  18.   lBmp := TBitmap.Create;
  19.   lBmp.LoadFromFile('usplegal.bmp');
  20.   lItem := lToolBar.AddItem(tikCheckButton);
  21.   lItem.Image := lBmp;
  22.   lItem.Caption := 'Btn 2';
  23.  
  24.   lItem := lToolBar.AddItem(tikDivider);
  25. end;

With this modification, the project runs without error, but opening the toolbar window displays a toolbar with empty buttons. I debugged into the Paint project, and was able to enter TCDDrawerCommon.DrawToolBarItem, but there is no indication that the buttons with the images are drawn somewhere...

Please report this in the bug tracker, maybe there is a developer who knows the CustomDrawn package better than me.

Mother10

  • Newbie
  • Posts: 4
Re: CustomDraw package compile error (lupa.bmp)
« Reply #5 on: November 06, 2025, 06:27:00 pm »
Thanks a lot.
problem: where do i find that bugtracker. I searched and found something but that seems very old?

https://bugs.freepascal.org/main_page.php
But i get an error there?

wp

  • Hero Member
  • *****
  • Posts: 13267
Re: CustomDraw package compile error (lupa.bmp)
« Reply #6 on: November 06, 2025, 07:11:32 pm »
The link is in the left sidebar of the forum ("Lazarus" > "Bug tracker"), the direct link is this: https://gitlab.com/freepascal.org/lazarus/lazarus/-/issues

Not 100% sure, but I think you must register at gitlab.com in order to be able to report a bug (this is free, for sure; some people report that they are asked for credit card data, if this happens you did something wrong). But if you don't want to do this I can report it myself, instead of you.

Mother10

  • Newbie
  • Posts: 4
Re: CustomDraw package compile error (lupa.bmp)
« Reply #7 on: November 06, 2025, 10:24:06 pm »
Thank you for all assistance.

I can do it, but as you already debugged some code, it is probably better you do it, if you want to.

really happy with all help :D

Cheers,
Tineke

wp

  • Hero Member
  • *****
  • Posts: 13267

Bart

  • Hero Member
  • *****
  • Posts: 5648
    • Bart en Mariska's Webstek
Re: CustomDraw package compile error (lupa.bmp)
« Reply #9 on: November 07, 2025, 12:14:32 pm »
Please report this in the bug tracker, maybe there is a developer who knows the CustomDrawn package better than me.

The CD WS is more or less dead in the water I would say.

Bart

wp

  • Hero Member
  • *****
  • Posts: 13267
Re: CustomDraw package compile error (lupa.bmp)
« Reply #10 on: November 07, 2025, 01:01:40 pm »
Yes, but maybe we are lucky and somebody gets motivated to put some time into this project. My impression is that since most of the infrastructure work has been done "only" the drawers should be completed.

Bart

  • Hero Member
  • *****
  • Posts: 5648
    • Bart en Mariska's Webstek
Re: CustomDraw package compile error (lupa.bmp)
« Reply #11 on: November 07, 2025, 06:06:14 pm »
Hmm, IIRC then there are multiple problems with even an empty form when build for CD WS like #24336 and #25461 (reported by me in the past).

Bart

Fred vS

  • Hero Member
  • *****
  • Posts: 3723
    • StrumPract is the musicians best friend
Re: CustomDraw package compile error (lupa.bmp)
« Reply #12 on: November 07, 2025, 06:51:04 pm »
Hmm, IIRC then there are multiple problems with even an empty form when build for CD WS like #24336 and #25461 (reported by me in the past).

Why reinvent the wheel? ( fpGUI and MSEide-MSEgui drive very well.)  :-\

Ok, ok, I leave....  ;)
« Last Edit: November 07, 2025, 06:54:41 pm by Fred vS »
I use Lazarus 2.2.0 32/64 and FPC 3.2.2 32/64 on Debian 11 64 bit, Windows 10, Windows 7 32/64, Windows XP 32,  FreeBSD 64.
Widgetset: fpGUI, MSEgui, Win32, GTK2, Qt.

https://github.com/fredvs
https://gitlab.com/fredvs
https://codeberg.org/fredvs

wp

  • Hero Member
  • *****
  • Posts: 13267
Re: CustomDraw package compile error (lupa.bmp)
« Reply #13 on: November 07, 2025, 08:07:02 pm »
then there are multiple problems
Why reinvent the wheel? ( fpGUI and MSEide-MSEgui drive very well.)  :-\
The main issue is that this widgetset is part of the Lazarus distribution, and a Lazarus user would expect it to work at least to some degree. But there are LOTS of problems, the widgetset is in a very early stage, and its developer has left the team... I wonder how the screenshot at https://wiki.freepascal.org/Lazarus_Custom_Drawn_Controls were created. And I read from time to time that developers for Android are proposed to use CustomDrawn. How is this going to work?
« Last Edit: November 07, 2025, 11:11:50 pm by wp »

lainz

  • Hero Member
  • *****
  • Posts: 4738
  • Web, Desktop & Android developer
    • https://lainz.github.io/
Re: CustomDraw package compile error (lupa.bmp)
« Reply #14 on: November 07, 2025, 11:14:40 pm »
Code: Pascal  [Select][+][-]
  1.  I wonder how the screenshot at https://wiki.freepascal.org/Lazarus_Custom_Drawn_Controls were created.

Hi, these are mine, but old screenshots, made with BGRABitmap.

The demo is available with BGRAControls.

 

TinyPortal © 2005-2018