I cannot insert any link !!! (SimpleGraph 2.0)

Please post bug reports, feature requests, or any question regarding the DELPHI AREA products here.

I cannot insert any link !!! (SimpleGraph 2.0)

Postby BadJoker » April 3rd, 2006, 11:18 pm

Hi,

Newbie here ...

I am using (TSimpleGraph v2.0) to generate some diagrams.

I have used the following code to link two nodes:

Code: Select all
procedure TForm1.Button1Click(Sender: TObject);
const
  NewNodeWidth = 100;
  NewNodeHeight = 75;
var
  NodeRect: TRect;
  NewNode1,NewNode2: TGraphNode;
  NewLink: TGraphLink;
begin

  SimpleGraph.beginUpdate;

  NodeRect.TopLeft := SimpleGraph.ClientToGraph(10,10);
  NodeRect.Right := NodeRect.Left + NewNodeWidth;
  NodeRect.Bottom := NodeRect.Top + NewNodeHeight;
  NewNode1 := SimpleGraph.InsertNode(NodeRect, TRectangularNode);
  NewNode1.Text := 'Test 1';


  NodeRect.TopLeft := SimpleGraph.ClientToGraph(150,150);
  NodeRect.Right := NodeRect.Left + NewNodeWidth;
  NodeRect.Bottom := NodeRect.Top + NewNodeHeight;
  NewNode2 := SimpleGraph.InsertNode(NodeRect, TRectangularNode);
  NewNode2.Text := 'Test 2';

  NewLink := SimpleGraph.InsertLink(NewNode1, NewNode2, TGraphLink);

  SimpleGraph.EndUpdate;
end;


I can simply create the nodes but I stuck in linking them together. NewLink returns nil for some reason!

Why is that?

P.S. I don't want to update my graph component so please give me a solution without updating the current system. Thank you
BadJoker
Active Member
Active Member
 
Posts: 7
Joined: April 3rd, 2006, 11:14 pm

Postby Kambiz » April 4th, 2006, 2:23 pm

That was a bug in v2.0 of the control.

If you don't want to upgrade to v2.61, you have to look at the latest code and find the fix by yourself.

However, I do suggest to upgrade to the latest version. You will not encounter to any incompatibility issue.
Kambiz
User avatar
Kambiz
Administrator
Administrator
 
Posts: 2408
Joined: March 7th, 2003, 7:10 pm

Postby BadJoker » April 4th, 2006, 11:45 pm

Thank you,
I will just do that
BadJoker
Active Member
Active Member
 
Posts: 7
Joined: April 3rd, 2006, 11:14 pm


Return to DELPHI AREA Products

Who is online

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