Create TSimpleGraph

Please discuss general Delphi programming topics here.

Create TSimpleGraph

Postby gdavin » January 24th, 2005, 4:09 pm

Hello :)

I want to dynamically create a TSimpleGraph with TRectangularNode.

Where I can find some example ?

Thanks
gdavin
Member
Member
 
Posts: 1
Joined: January 24th, 2005, 4:04 pm

Postby Stefan » January 24th, 2005, 4:45 pm

Hi,

Something like this should work:

Code: Select all
procedure TForm1.SomeProc;
begin
  Graph := TSimpleGraph.Create(Form1);
  with Graph do begin
    Parent := Form1;
    Left := 0;
    Top := 0;
    Width := 400;
    Height := 400;
    ZoomMax := 1000;
  end;
end;

procedure TForm1.SomeOtherProc;
var
  r: TRect;
  node: TGraphNode;
begin
  r := Rect(20, 20, 250, 50);
  node := Graph.InsertNode(@r);
  node.Text := 'Node text!';
end;



Cheers,
Stefan
User avatar
Stefan
Moderator
Moderator
 
Posts: 128
Joined: September 27th, 2004, 9:40 am
Location: Tilburg, The Netherlands


Return to Delphi Programming

Who is online

Users browsing this forum: Bing [Bot] and 1 guest

cron