Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Draw Arrow into a shapenode or in a shapenode (Read 1902 times)
Martin Mc
YaBB Newbies
*
Offline



Posts: 11
Location: Bracknell
Joined: Oct 23rd, 2008
Draw Arrow into a shapenode or in a shapenode
Jul 25th, 2012 at 5:51pm
Print Post  
I seem to be failing to find a solution for this simple task.

I want to draw a box (Shape) then i want to draw an arrow (link) then starts from outside the box but ends up in the box.  The problem is the link tries to automatically anchor to the box.

sounds simple but i have struggled many a moon to try and resolve this one. i have tried turning off allowincomming and out going links but you get a no entry sign when you draw into the box. Ive also tried setting anchor patterns to nothing so it wont latch onto the box.

I can get this to work with a link that is not a polyline, but i want a single straight line.

Any help would be great.

  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Draw Arrow into a shapenode or in a shapenode
Reply #1 - Jul 26th, 2012 at 9:47am
Print Post  
You could move the last control point to the current mouse pointer location:

Code
Select All
private void diagram_LinkCreated(object sender, LinkEventArgs e)
{
	DiagramLink link = e.Link;
	link.ControlPoints[link.ControlPoints.Count - 1] =
		diagramView.ClientToDoc(diagramView.PointToClient(MousePosition));
	link.UpdateFromPoints();
} 



I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
Martin Mc
YaBB Newbies
*
Offline



Posts: 11
Location: Bracknell
Joined: Oct 23rd, 2008
Re: Draw Arrow into a shapenode or in a shapenode
Reply #2 - Jul 27th, 2012 at 2:26pm
Print Post  
Thanks for this. I managed to stumble across a solution by accident in the end, all you have to do is make all nodes / boxes locked before adding the links, works perfectly.

Thanks for your suggestion though.
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Draw Arrow into a shapenode or in a shapenode
Reply #3 - Jul 27th, 2012 at 3:57pm
Print Post  
Locked nodes + AllowUnconnectedLinks will create the link exactly at the end point, but will not associate links with nodes (link.Destination will remain null). I suppose that will work for you if using the control only as a drawing tool and don't need to traverse the graph later.
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint