Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Diagram.LinkModified (Read 1870 times)
Benoit Caron
YaBB Newbies
*
Offline



Posts: 10
Joined: Apr 8th, 2009
Diagram.LinkModified
Apr 8th, 2009 at 9:06pm
Print Post  
Hello everyone,

Hi have the following property values in my diagram

  • Diagram.AllowUnanchoredLinks = false
    Diagram.AllowUnconnectedLinks = false


When moving a selected node in the diagram, every links connected to it is changed to follow the node.  However, neither of the following events are raised: Diagram.LinkModifying and Diagram.LinkModified.  Is this the correct behaviour?

If the link is also selected, Diagram.LinkModified is raised but Diagram.LinkModifying is not.  Is that also the correct behaqviour?

I was expecting these events to be raised as soon as the link changes, by direct manipulation or as a side effect.

thanks,
Benoît Caron
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Diagram.LinkModified
Reply #1 - Apr 9th, 2009 at 7:53am
Print Post  
Hi,

LinkModifying is a validation event and designed mostly to let you prevent the user from connecting a link to some nodes. Raising it while a node is being modified brings a similar question as in your other post - what should happen if you set e.Cancel or call e.CancelDrag() fore some link while a node is being modified.

Stoyan
  
Back to top
 
IP Logged
 
Benoit Caron
YaBB Newbies
*
Offline



Posts: 10
Joined: Apr 8th, 2009
Re: Diagram.LinkModified
Reply #2 - Apr 9th, 2009 at 1:47pm
Print Post  
I understand.

What I want to do is to update the bezier control points of the link to keep a nice curve has I'm moving the node.  I was looking for an event on the link.

I ended up relying on NodeModifying and SelectionMoving but I have to look for every possible connection on every anchor to do it.

Any suggestion?

thanks,
Benoît
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Diagram.LinkModified
Reply #3 - Apr 9th, 2009 at 2:19pm
Print Post  
You will have to do something similar:

Code
Select All
void MakeNiceCurve(DiagramLink link)
{
...
}

void OnLinkModified(...)
{
	MakeNiceCurve(e.Link);
}

void OnNodeModified(...)
{
	DiagramLinkCollection links = e.Node.GetAllLinks();
	foreach (DiagramLink link in links)
		MakeNiceCurve(e.Link);
}

void OnSelectionMoved(...)
{
	// loop over Selection.Nodes and Selection.Links and process them as above
}
 



I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
Benoit Caron
YaBB Newbies
*
Offline



Posts: 10
Joined: Apr 8th, 2009
Re: Diagram.LinkModified
Reply #4 - Apr 9th, 2009 at 3:13pm
Print Post  
yep, this is exactly what I ended up doing Smiley

thanks

  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint