Recent

Author Topic: Bug in TImageList?!  (Read 400 times)

Nicole

  • Hero Member
  • *****
  • Posts: 1271
Bug in TImageList?!
« on: October 07, 2025, 12:17:49 pm »
Bug in TImageList?!

I do not dare to post this as bug, because I have no idea, how to reproduce.
In my form1 there is a TImageList1 filled with many icons.

All through my app I use it:
I set "images" to ImageList1.

This is true in my case for TSpeedButton and for TPageControl.
Then I chose a number of the ImageList1 and the icons are in both cases shown fine.
For days, for weeks, for months.

Then one day I open an frame, where I used it, and all the images are gone.
I say to myself, "haven't I done this already"? and restart the process.

Surprise!
The moment I re-set the property images of the TSpeedButton or TPageControl,
all my icons re-appear with their correct number.

In other words: Anything seems to remove the property "images".
As this is true for TSpeedButton as well as for TPageControl, I cannot guess, where the problem may come from.

I am sorry, that I have no idea, which causes this, as it works fine for a long time.
However, this has happened so often, that it cannot be my mistake any more.

Sorry, I cannot make a "simple project".
You would end up in opening it and say "all looks fine".
It looks fine for me as well, - for a long time.
The lost image-links have nothing in common. It happened all over my project.

Thaddy

  • Hero Member
  • *****
  • Posts: 18344
  • Here stood a man who saw the Elbe and jumped it.
Re: Bug in TImageList?!
« Reply #1 on: October 07, 2025, 01:54:50 pm »
I suppose you are trying to include the images as a resource?
Then do a build, not just compile. The resource compiler needs to be called.
Due to censorship, I changed this to "Nelly the Elephant". Keeps the message clear.

Nicole

  • Hero Member
  • *****
  • Posts: 1271
Re: Bug in TImageList?!
« Reply #2 on: October 07, 2025, 02:59:13 pm »
No, I don't.
I just start my software from the IDE.

Sometimes the images are there, now and then they are gone.

I do not think, this has to do with resources. The images are not ALL gone. They just disappear in a certain area, e.g. all Tabsheet icon of a child-page control. The other page control are fine.

wp

  • Hero Member
  • *****
  • Posts: 13213
Re: Bug in TImageList?!
« Reply #3 on: October 07, 2025, 02:59:50 pm »
Not 100% sure that I am not confusing something...: Where is the ImageList stored? On a datamodule? I think I remember the case that when the datamodule was not open in the project then its images could not be displayed in the forms where it was used. Just verified that this is not happening any more, but several versions back - maybe... What is the oldest Lazarus version that you had used to open your project?

Nicole

  • Hero Member
  • *****
  • Posts: 1271
Re: Bug in TImageList?!
« Reply #4 on: October 07, 2025, 03:41:00 pm »
The imageList is on my main form, which is called "form1" in typical demos.

I have Lazarus 4.0.
However, this strange thing is older than the use of 4.0.
My version before was something with 3. Not sure, which. By sure not the very last with 3.



Thaddy

  • Hero Member
  • *****
  • Posts: 18344
  • Here stood a man who saw the Elbe and jumped it.
Re: Bug in TImageList?!
« Reply #5 on: October 07, 2025, 03:45:35 pm »
Build The Hives playing again.
Due to censorship, I changed this to "Nelly the Elephant". Keeps the message clear.

Nicole

  • Hero Member
  • *****
  • Posts: 1271
Re: Bug in TImageList?!
« Reply #6 on: October 09, 2025, 09:56:35 am »
It did it again!
I suspected, the images are not really "not done yet", but disappeared again.
So I saved the file before working with it.

The frame with the ending
- "frame_sektoren_ohne_" is "ohne" = without the images.
The frame
-  "frame_sektoren_" is the partly "corrected" one (the
- "SpeedButton_FuelleSektoren" is corrected, the
- "SpeedButton_Branchen" is not).
I corrected the first TSpeedButton in the way, that I re-added the property images.
This caused the chosen image to re-appear.

The Form form_maintiger_ contains the images =
- "Form_MainTiger.ImageList_16er"

Is this useful for anybody?
You will not be able to start the project, because it is very huge and nested.
The moment I extract a small version, this nasty bug will be gone.
Maybe a comparison of the frame_sektoren_ohne with the frame_sektoren_ says anything to a developer.

As I am not able to provide a project to reproduce, I provide screenshots.

 

TinyPortal © 2005-2018