Hi
Delphi 7 Pro; Win2K; TeeChartPro 7.07 with full source.
I implement checkbox functionality in TeeTree using the OnClickShape event.
This works OK until the tree has a number of nodes requiring a scroll to select the lower nodes or the tree is dragged manually vertically or horizontally (scroll bars appear) .
If the tree is scrolled and the checkbox of any visible node is clicked, the OnClickShape event is not fired or is fired for the wrong node. However, if the node text is clicked then the event fires for the correct node.
So, what appears to be happening is that the target area to respond to mouse clicks for the OnClickShape event is incorrect after scrolling the tree.
Please advise a solution.
Roland.
OnClickShape Bug in TeeTree
Hi,
yup, it's a bug
In method (teeTree.pas):
Change:
to:
(do not forget to add tmpX and tmpY to the var section of the method
Regards,
Tom.
yup, it's a bug
In method (teeTree.pas):
Code: Select all
// Returns True when the point (XY) is inside the shape bounds
Function TTreeNodeShape.Clicked(x,y:Integer):Boolean;
Code: Select all
if FVisible and InsideTreeBounds then
...
if (not result) and (FImageAlignment<>iaCenter) then
result:=ClickedImage(x,y);
Code: Select all
tmpX := X;
tmpY := Y;
if FVisible and InsideTreeBounds then
...
if (not result) and (FImageAlignment<>iaCenter) then
result:=ClickedImage(tmpx,tmpy);
Regards,
Tom.