Lazarus
Programming => Graphics and Multimedia => TAChart => Topic started by: mtanner on April 02, 2016, 12:52:21 pm
-
This is probbaly an idiot's question.
I have a TTabControl with an imagelist assigned to the Images property of the TTabControl. But the images do not appear on the tabs. Apart from assigning the imagelist, what else do I have to do to make the images appear?i
-
Use the OnGetImageIndex event.
-
Could you please elaborate a bit more? What I expected was for the imagelist for a TTabControl to operate like an imagelist for a popupmenu or a toolbar, where assigning the imagelist and image indices for the components is enough, with no need for user-coding in events.
-
Hey come on, what is the problem to double-click at the OnGetImageIndex event of the TTabControl and look at the auto-generated code? You will see immediately how you can assign an image index to a tabsheet. It is a bit different from what you know from a menu item or toolbutton because all tabs of the TTabControl are the same, they only differ by their caption which is defined in a stringlist..
-
Well of course I can easily create an OnGetImageIndex event. I tried using the event to assign an ImageIndex, no difference. The event handler is actually receiving the correct ImageIndex any way. (The ImageIndex value I'd want to use will allways be the TabIndex value, which is the default. )
To be clear, I'm talking about a TTabControl, not a TPageControl. With TPageControl, if I assign an imagelist to the TPageControl.Images, then set the ImageIndex property of a contained TTabsheet, then the image referenced appears on the tab, just as I'd expect.
-
Now I tried it myself, and yes, you are right - there are no images at the tabs of a TTabcontrol although Images are assigned to it and there is a handler for the OnGetImageIndex event. This seems to be a bug. Please write a bug report that somebody can take care of it. Add a little project to the report to demonstrate the issue (only pas, lfm, lpi and lpr files, no exe, ppu or other files generated by the compiler; all packed into a single zip).
-
Sorry for the thread necromancy... I've stumbled upon this topic 6 years ago and it seems to still remain the same.
Does anybody know if this was finally reported as a bug?
-
Sorry for the thread necromancy... I've stumbled upon this topic 6 years ago and it seems to still remain the same.
Does anybody know if this was finally reported as a bug?
Yes, it was reported 9 years ago. https://gitlab.com/freepascal.org/lazarus/lazarus/-/issues/23068.
Why it is in a TAChart forum is a mystery though.