TTree ConnectionPoints
Posted: Fri Jun 17, 2005 10:30 pm
I have 2 TreeNodeShapes with a connection between them. I try and add some additional points to the connection. The added points appear but the end points are no longer "linked" to the Shapes. I've tried reassigning the ToShape,FromShape nothing. How can you progamatically reconnect the connection to the shapes ??
I'm missing something.
Thanks,
Sample Code.
var
nd : TTreeNodeShape;
nd2 : TTreeNodeShape;
cn : TTreeConnection;
cp : TConnectionPoint;
p : TPen;
begin
t1.Designing := true;
nd := t1.Items.AddChild(nil,'Hello?');
nd.Style := tssRectangle;
nd.Top := 120;
nd.left := 120;
nd2 := t1.Items.AddChild(nil,'World');
nd2.Style := tssRectangle;
nd2.Top := 120;
nd2.left := 320;
cn := nd.addconnection(nd2);
cn.Points.add(cpsfixed,120,cpsfixed,120);
cn.Points.add(cpsfixed,220,cpsfixed,220);
cn.Points.add(cpsfixed,320,cpsfixed,120);
cn.Border.SmallDots := false;
cn.Border.Style := pssolid;
cn.border.width := 1;
cn.SimpleText := 'Stuff';
cn.FromShape := nd;
cn.ToShape := nd2;
I'm missing something.
Thanks,
Sample Code.
var
nd : TTreeNodeShape;
nd2 : TTreeNodeShape;
cn : TTreeConnection;
cp : TConnectionPoint;
p : TPen;
begin
t1.Designing := true;
nd := t1.Items.AddChild(nil,'Hello?');
nd.Style := tssRectangle;
nd.Top := 120;
nd.left := 120;
nd2 := t1.Items.AddChild(nil,'World');
nd2.Style := tssRectangle;
nd2.Top := 120;
nd2.left := 320;
cn := nd.addconnection(nd2);
cn.Points.add(cpsfixed,120,cpsfixed,120);
cn.Points.add(cpsfixed,220,cpsfixed,220);
cn.Points.add(cpsfixed,320,cpsfixed,120);
cn.Border.SmallDots := false;
cn.Border.Style := pssolid;
cn.border.width := 1;
cn.SimpleText := 'Stuff';
cn.FromShape := nd;
cn.ToShape := nd2;