Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic LinkValidationEventArgs error on a straight link (Read 1755 times)
billcch
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 8
Joined: Nov 15th, 2007
LinkValidationEventArgs error on a straight link
Oct 15th, 2009 at 12:45am
Print Post  
LinkModifying question:
I am using DiagramLinks to connect TableNodes. When user drags an arrow HEAD (connect to destination table), if the link contains at least one segment, it works well, however, if there is no segment in the link, on the event of diagram1_LinkModifying, the LinkValidationEventArgs "e" contains the following weird values:
e.AnchorIndex = -1
e.ChangingDestination = false
e.ChangingOrigin = false
e.Node= null
e.TableRow = -1

If I tried to generate a segment on the same link in the diagrm (ex: moving the destination tableNode), then it works. Again, changing the link back to a straight line (no segment), the problem occurs.

BTW: I am using FlowChart.Net Pro 5.1.1

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


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: LinkValidationEventArgs error on a straight li
Reply #1 - Oct 15th, 2009 at 9:26am
Print Post  
I suppose you would get such values when dragging an intermediate control point rather than one at the end. If you are using Cascading links, this might happen if SegmentCount == 2; then the last two points could overlap and grabbing a handle at the link's end might select the one for the intermediate point. Try setting SegmentCount = 3 to move the intermediate points to the middle of the link.
  
Back to top
 
IP Logged
 
billcch
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 8
Joined: Nov 15th, 2007
Re: LinkValidationEventArgs error on a straight li
Reply #2 - Oct 15th, 2009 at 4:35pm
Print Post  
I did set link.SegmentCount = 3, but it seems not working, after I apply the layout, it changed back to 2.


Code
Select All
link.Pen.Color = linkInfo.LineColor;
link.Brush = new MindFusion.Drawing.SolidBrush(linkInfo.FillColor);
link.ShadowOffsetX = 0;
link.ShadowOffsetY = 0;
link.HeadShape = ArrowHead.Triangle;
link.HeadShapeSize = 4;
link.BaseShape = ArrowHead.RevTriangle;
link.BaseShapeSize = 4;
link.HandlesStyle = HandlesStyle.MoveOnly;
link.Style = LinkStyle.Cascading;
link.SegmentCount = 3;
link.DrawCrossings = true;
link.Dynamic = true;
link.SnapToNodeBorder = true;
 




Code
Select All
MindFusion.Diagramming.Layout.LayeredLayout layout = new MindFusion.Diagramming.Layout.LayeredLayout();
layout.Anchoring = Anchoring.Reassign;
layout.Direction = MindFusion.Diagramming.Layout.Direction.Straight;
layout.IgnoreNodeSize = false;
layout.LinkType = MindFusion.Diagramming.Layout.LayeredLayoutLinkType.Cascading;
layout.KeepGroupLayout = true;
layout.MultipleGraphsPlacement = MindFusion.Diagramming.Layout.MultipleGraphsPlacement.Vertical;
layout.Orientation = MindFusion.Diagramming.Layout.Orientation.Horizontal;
layout.SplitLayers = true;
 


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


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: LinkValidationEventArgs error on a straight li
Reply #3 - Oct 15th, 2009 at 5:49pm
Print Post  
LayeredLayout should set the links' SegmentCount to at least 3 segments. Perhaps you have some additional code after the LayeredLayout.Arrange call that changes it to 2?
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint