Group: Forum Members
Last Active: 6 Months Ago
We programatically create lines between shapes.
The user needs to be able to select the line because I show relationship information when they do.
However, we do not want to let the drag the connector off the connected shapes. But I do need to move the shapes connected to around.
We have diabled the connector endpoints, but they can still grab the middle of the line and drag it off.
I have tried setting the protections to not allow change X or Y; And I have tried setting the moveable filter in the movetool. In both these cases it almost works but it unselects the line on mouse up after I click on the line to select. Strangely I can still select the line with a rectangle area drag select.
I also tried catching the eventsink_disconnecting event and canceling but there are places we programatically disconnect lines and I'd have to pause the eventsink or use booleans flags to control that behavior. There are problems with both of those approaches.
Setting the protections or moveable filter would be the most desirable approach that I've tried if it would just not unselect after I click on the line (note the diagram designer sample app does the same thing.) Can I prevent that?
Is there any other easier option I haven't tried to prevent the user for disconnecting, but not interfere with programatic disconnecting?
Thanks in advance,
Last Active: 10 hours ago
In order to disable the disconnection of a connector but leave it selectable, you should set its MoveX
NAbilities protection = connector.Protection;
protection.MoveX = true;
protection.MoveY = true;
protection.TrackersEdit = true;
connector.Protection = protection;
Nevron Support Team