Page 1 of 1

Connector problem

Posted: Mon Oct 30, 2006 4:25 pm
by 9343260
Hello,

Have a look on my 3 connectors : I want the 3 "derivative" nodes to be at the same position (see the red line). But you see the images of their parents are not the same size (1 is tiChecked, and 2 are larger custom images), and this leads to a small shift of the connectors (see the 3 red circles).

Is it possible to change the connectors' starting position to have them all look the same way ?

I hope you see what i mean. Here is the illustration :

Image

Posted: Mon Oct 30, 2006 7:10 pm
by Tom
Hi bertrod,

There are several ways to solve this issue:

1. You can set the Left property of the shape

2. Better: You create your own TChildManager which takes this issue into account. The easiest way would be to descend from TTreeExplorerAlignChild (you propably only have to override the XPosition function)

3. Easiest: You create another custom image, with the same width as the other custom images, which contains the checkbox and space.

Regards,
tom

Posted: Tue Oct 31, 2006 12:30 pm
by 9343260
Hello,

I followed the 2nd solution. But I didn't create a new TChildManager; I directly changed the source code of teeTree.pas because there was just one line to change.

I changed the TTreeExplorerAlignChild.CalcXYCross function :

Old version :

Code: Select all

result.X:=AdjustedRectangle.Left+Tree.ChartBounds.Left+((X0-AdjustedRectangle.Left-TeePictureHorizMargin) div 2)
New version :

Code: Select all

result.X := AdjustedRectangle.Left + Tree.ChartBounds.Left + 6
6 represents half the size of the checkbox's image

Thanks for your help Tom.