| View previous topic :: View next topic |
| Author |
Message |
HPW Senior Member
Joined: 25 Feb 2006 Posts: 120 Location: Germany
|
Posted: 27/03/06 10:21 Post subject: InsertLink by code with breakpoint? |
|
|
When I want to insert a link by code between 2 nodes but with a breakpoint, what is the way to go?
| Code: |
function InsertLink(Source, Target: TGraphObject; ALinkClass: TGraphLinkClass = nil): TGraphLink;
function InsertLink(Source: TGraphObject; const Pts: array of TPoint; ALinkClass: TGraphLinkClass = nil): TGraphLink;
function InsertLink(const Pts: array of TPoint; Target: TGraphObject; ALinkClass: TGraphLinkClass = nil): TGraphLink;
function InsertLink(const Pts: array of TPoint; ALinkClass: TGraphLinkClass = nil): TGraphLink;
|
The first version only links directly.
Does the versions with the Start/end-Pts link to a node which can be found there?
_________________ Hans-Peter |
|
| Back to top |
|
 |
Kambiz Administrator

Joined: 07 Mar 2003 Posts: 1044 Location: Tehran, Iran
|
Posted: 27/03/06 11:15 Post subject: |
|
|
Directrly use TGraphLink.CreateNew constructor.
_________________ Kambiz |
|
| Back to top |
|
 |
HPW Senior Member
Joined: 25 Feb 2006 Posts: 120 Location: Germany
|
Posted: 27/03/06 11:26 Post subject: |
|
|
Oops, I missed it.
Thanks for the info.
_________________ Hans-Peter |
|
| Back to top |
|
 |
HPW Senior Member
Joined: 25 Feb 2006 Posts: 120 Location: Germany
|
Posted: 18/04/06 11:18 Post subject: |
|
|
I am trying to do this, but currently a bit struggled to build the array dynamicly:
| Code: |
VAR
ptarray : array of TPoint;
....
J := 1;
FOR I := 0 TO ArrayCount DO
BEGIN
pt := point(....);
ptarray[J] := pt;
Inc(J);
END;
|
Giving me access-violations.
_________________ Hans-Peter |
|
| Back to top |
|
 |
HPW Senior Member
Joined: 25 Feb 2006 Posts: 120 Location: Germany
|
Posted: 18/04/06 12:32 Post subject: |
|
|
I finally managed it with:
SetLength(ptarray, acount);
_________________ Hans-Peter |
|
| Back to top |
|
 |
|