Hi
I had to change the source code of teetree by dding the line shown below,
because when I assign a image index to a tree node, the image is correctly assigned but the image index itself never
changes and I need to know the image index later so I made a small change in
their code (added line 6788).
Rgds
Peter
procedure TTreeNodeShape.SetImageListIndex(const Value:Integer);
begin
if FImageListIndex<>Value then
begin
FImageListIndex:=Value; // just set the variable. Do not free FImage.
FreeAndNil(FImage); //tom:01/09/2002 Otherwise Images are drawn on top of each other...
RecalcImageSize;
// line 6788 added
FImageListIndex:=Value; // the above line resets the ImageListIndex (!)
CanvasChanged(Self);
end;
end;
Poss Ttree image index bug
-
- Newbie
- Posts: 3
- Joined: Sun Mar 09, 2003 5:00 am
- Contact:
ImageListIndex does not update
I had a similar problem, but I've recompiled the source and my code now works like a charm. Thank you Peter for posting this kind advice.
Re: Poss Ttree image index bug
The latest version still has this problem.
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Re: Poss Ttree image index bug
Hi Cyionics,
I'd like to apologise for the lack of response here. Could you please attach a simple example project we can run "as-is" with which we can reproduce the problem here and we will investigate it and try to apply the fix you suggested?
Thanks again for your collaboration.
I'd like to apologise for the lack of response here. Could you please attach a simple example project we can run "as-is" with which we can reproduce the problem here and we will investigate it and try to apply the fix you suggested?
Thanks again for your collaboration.
Best Regards,
Narcís Calvet / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |
Re: Poss Ttree image index bug
Here is a program that creates two tree nodes and assigns 0 and 1 to their ImageListIndex properties, respectively, in the form's OnCreate. When you click the button it reads the ImageListIndex property of the first node, and it returns -1 even though the image is correctly set.
TTreeNodeShape.SetImageListIndex calls RecalcImageSize and that procedure (by calling some other procedures) causes the FImageListIndex variable to be reset to -1.
TTreeNodeShape.SetImageListIndex calls RecalcImageSize and that procedure (by calling some other procedures) causes the FImageListIndex variable to be reset to -1.
- Attachments
-
- SetImageListIndex.zip
- (2.17 KiB) Downloaded 1493 times
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Re: Poss Ttree image index bug
Hi Cyionics,
Thank you very much for your project. I have checked your solution proposal solves the issue. We will investigate a little bit further and consider it for inclusion in the next maintenance release.
Thank you very much for your project. I have checked your solution proposal solves the issue. We will investigate a little bit further and consider it for inclusion in the next maintenance release.
Best Regards,
Narcís Calvet / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |