Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Double Clicking Nodes when locked (Read 2277 times)
donalmeida
Junior Member
**
Offline


Yay...

Posts: 65
Joined: Oct 6th, 2009
Double Clicking Nodes when locked
Oct 19th, 2009 at 5:25pm
Print Post  
We need to lock all nodes/links based on a business rule.
I am locking all nodes like this:
foreach(DiagramNode node in  diagram.Nodes)
           {
               if (node is ContainerNode)
               {
                   node.Locked = !isFlowLockedByUser;
                  
               }
           }
I have an event handler that is fired whenever a node is double clicked. defined like this:
private void Map1_NodeDoubleClicked(object sender, NodeEventArgs e)

However, if the Nodes are locked The Double click event is not fired. The Link Double click event handler works fine even if the links are locked. We would like the double click event handler to fire even if the node is Locked. is there a way to do this... 

  

Don Almeida.
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Double Clicking Nodes when locked
Reply #1 - Oct 20th, 2009 at 12:39pm
Print Post  
Yes, the event should be raised even for locked nodes. We'll try to fix this today and upload the updated version.

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


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Double Clicking Nodes when locked
Reply #2 - Oct 21st, 2009 at 9:02am
Print Post  
  
Back to top
 
IP Logged
 
donalmeida
Junior Member
**
Offline


Yay...

Posts: 65
Joined: Oct 6th, 2009
Re: Double Clicking Nodes when locked
Reply #3 - Oct 21st, 2009 at 11:01pm
Print Post  
Stoyan,
Thanks for the new DLLS. However, we have a small issues with the way the routes are drawn now after referencing the new DLLS. 

oops... How do we upload images? on this forum?
  

Don Almeida.
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Double Clicking Nodes when locked
Reply #4 - Oct 22nd, 2009 at 5:37am
Print Post  
Hi Don,

Please set a breakpoint at the start of this code and check how many points are there in the link, and what is the link.Style value:

Code
Select All
// GET the First point that the link starts from.
points.Add(new Point(link.ControlPoints[0].X, link.ControlPoints[0].Y));

// add the next two middle  points
for (int x = 0; x < pointList.Count; x++)
{
	Point point = new Point
	{
		X = pointList[x].localXPosition,
		Y = pointList[x].localYPosition
	};
	points.Add(point);
}

// Add the Last Point
points.Add(new Point(link.ControlPoints[1].X, link.ControlPoints[1].Y));
 



It seems that code expects that each link is a polyline with one segment / two points when it runs? If you get links with a different number of points, you are in trouble, because you might be setting one of the intermediate points location as the final end point of the link. So instead of adding ControlPoints[1], try adding ControlPoints[ControlPoints.Count - 1].

I've just recalled you had an issue where the text was not centered by default for Bezier links, because the intermediate points where not distributed correctly along the link length, but all were placed at the link's end. We've fixed this, and now ControlPoints[1] is not at the link's end, but nearer to the start point. I'm pretty sure that causes the problem in your link loading code now.

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint