Page 1 of 1

OnClickShape Bug in TeeTree

Posted: Thu Dec 07, 2006 1:50 am
by 9339335
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.

Posted: Fri Dec 08, 2006 5:43 pm
by Tom
Hi,

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;
Change:

Code: Select all

  if FVisible and InsideTreeBounds then
  ...
    if (not result) and (FImageAlignment<>iaCenter) then
       result:=ClickedImage(x,y);
to:

Code: Select all

  tmpX := X;
  tmpY := Y;
  if FVisible and InsideTreeBounds then
  ...
    if (not result) and (FImageAlignment<>iaCenter) then
       result:=ClickedImage(tmpx,tmpy);
(do not forget to add tmpX and tmpY to the var section of the method

Regards,
Tom.

Posted: Sat Dec 09, 2006 2:10 am
by 9339335
Thanks Tom

That appears to have fixed the problem.

Cheers

Roland