Hi,
This is my first run at the diagram studio and the lack of some really basic programmatic examples is making my head hurt. I've spent about 1/2 a day on this and need to put it down for a bit, so a good time to ask a question. I was trying to throw a load of ellipses (which represent a single rooted hierarchy) with a number of child ellipses. It is action one ellipse per web page in a "up linked" site.
The following is cobbled from your examples and help file, so needs tidying obvs.
This just puts all the ellipses on top of each other and then I use the forceLayout example and it basically all the ellipses dissappear. If you use the navigator, it looks like it makes the canvas / scroll area really really huge, i.e. the red box becomes a pixel.
I thought I could throw the 800 odd ellipses on there and it would lay them out for me. While I am it, there are 10 examples? I am looking for pretty basic programmatic manipulation of the diagram.
TIA
JAC
procedure TfraPageDiagram.AddObject(v: TjHTMLFile);
var
MyBlock : TDiagramBlock;
idx : Integer;
myLine : TDiagramLine;
begin
MyBlock := TDiagramBlock.Create(atdgrmDiagram.Owner);
with MyBlock do
begin
Left := 10;
Top := 10;
Shape := bsEllipse;
// Text:=v.UpdatedFileName;
TextCells[0].Text:=v.UpdatedFileName;
Width := 50;
Height := 30;
Obj :=V;
MyBlock.LinkPoints.Add((MyBlock.Right - MyBlock.Left)/2,MyBlock.top,aoup);
MyBlock.LinkPoints.Add((MyBlock.Right - MyBlock.Left)/2,MyBlock.bottom,aoDown);
Diagram := atdgrmDiagram;
if v.Parent <> nil then
begin
idx:=atdgrmDiagram.BlockCount-1;
while idx >= 0 do
begin
if atdgrmDiagram.Blocks[idx].Obj = v.Parent then
begin
MyLine := TDiagramLine.Create(atdgrmDiagram.Owner);
myLine.Diagram := atdgrmDiagram;
myLine.SourceLinkPoint.AnchorLink := MyBlock.LinkPoints[0]; //link start point to someblock
myLine.TargetLinkPoint.AnchorLink := atdgrmDiagram.Blocks[idx].LinkPoints[1]; // link end point to anotherblock
myLine.RequiresConnections:=true;
end;
Dec(idx);
end;
end;
end;
end;