OnClickShape Bug in TeeTree

TeeTree VCL for Borland Delphi and C++ Builder.
Post Reply
Roland
Newbie
Newbie
Posts: 5
Joined: Wed Sep 29, 2004 4:00 am

OnClickShape Bug in TeeTree

Post by Roland » Thu Dec 07, 2006 1:50 am

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.

tom
Advanced
Posts: 211
Joined: Mon Dec 01, 2003 5:00 am
Contact:

Post by tom » Fri Dec 08, 2006 5:43 pm

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.

Roland
Newbie
Newbie
Posts: 5
Joined: Wed Sep 29, 2004 4:00 am

Post by Roland » Sat Dec 09, 2006 2:10 am

Thanks Tom

That appears to have fixed the problem.

Cheers

Roland

Post Reply