Hi
I'm trying to support splitting a DiagramLink into segments as the user is creating it.
My behavior implements StartDraw, and in the situation where I wish to create link it does the following:
return gcnew InteractionState(gcnew DiagramLink(Diagram, node, a_point), -1, Action::Create);
This works fine for link creation in general.
In another place I respond to a key press event and do the following:
if (InteractionState ^interaction = Diagram->Interaction)
{
if (interaction->Action == Action::Create)
{
if (DiagramLink ^link = dynamic_cast<DiagramLink ^>(interaction->CurrentItem))
{
link->ControlPoints->Insert(link->ControlPoints->Count-1, interaction->CurrentPoint);
link->UpdateFromPoints();
}
}
}
This doesn't appear to influence the link during its creation as it remains a straight unsplit line. When the link is dropped on a valid anchor, the extra handles appear, but they don't appear in the correct places; they appear along the straight line, but they do break up the segment at the correct 'time'.
Is this something I could expect to get working easily? I know I can custom draw a link if necessary, but I had hoped this would be possible without doing so
Note that I only need to support Polyline at this time.
Thanks,
James