Hello again!
I'm still using FC.NET 4.3.1, .NET 2.0
I'm giving the user a possibility to draw their charts with PolyLine arrows with one segment to start with, so a straight line will always be what they draw from one box to another. Then they have the option to insert control points, which is standard functionality of FC.NET.
I also use "snap to grid" to allow them to more easily align objects to each other.
This snap to grid causes some problems when users move control points of an arrow. When a user wants to connect to point exactly to the side of a table or box sometimes the snap to grid forces the point to be outside of the table. Because I do not allow unconnected arrows, the point snaps back to it's original position when released.
So I added the option for them to hold the shift key while modifying these points. This key temporarily disabled the snap to grid option. This allows them to more accuratly place an arrow endpoint to the side of a table or box. However, because there is no snap to grid it's hard to get straight lines.
I know the Cascading option will allow ONLY straight lines to be drawn, but this is not an option, as they whish to be able to draw straight lines to other boxes.
What I'm really missing is (basically) an option that when the user is modifying the points, they automatically position themselves so that they for a straight line with the next and previous point. Very much like in Illustrator and Photoshop, where pressing shift (or something) makes sure you can only draw lines at certain angles.
I've done a basic attempt by implementing some code in the ArrowModifying event, but you can't really position the point the user is modifying... am I right?
Here is what I was playing with:
Private Sub OnArrowModifying(ByVal sender As System.Object, ByVal e As MindFusion.Diagramming.WinForms.ArrowConfirmArgs) Handles mMainFlowChart.ArrowModifying
' First we need to see what point is being modified
Dim c As Integer = e.Arrow.ControlPoints.Count
Dim lPointIndex As Integer = 0
For i As Integer = 0 To c - 1
If e.Arrow.ControlPoints(i).Equals(e.Point) Then
lPointIndex = i
Exit For
End If
Next
Me.SetStatusBarText("The index: " & lPointIndex)
e.Arrow.ControlPoints(lPointIndex) = New PointF(0, 0)
e.Arrow.UpdateFromPoints()
End Sub
Here I'm trying to force the point the user is modifying to go to the top left corner, but the code does nothing at all...
Any tips on how I could make this kind of functionality happen anyway?
Quite a long post, sorry about that!