Poss Ttree image index bug
Posted: Sun Jan 30, 2005 9:48 pm
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;
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;