Nevron Forum

Connector tool.

https://www.nevron.com/Forum/Topic2473.aspx

By michal bandrowski - Thursday, July 9, 2009

In Nevron Diagram WinForm Exaples, there is in Diagram Designer a Connector Tool available.
I'd like to add similar one, but when I call for activate, it always adds starting point, and I'm able to define only end point.

How should I activate it to be able to specyfiy with mouse starting point as well?

Ex:
--

NCreateConnectorTool tool = view.Controller.Tools.GetToolByName("Create connector tool") as CreateConnectorTool;
tool.ConnectorType = ConnectorType.SideToSide;

tool.Activate();
By Ivo Milanov - Thursday, July 30, 2009

Hi Michal,

By default the Activate method of the connector tool gets the mouse information directly from the Controller.MouseInfo property. The MouseInfo is automatically updated by the Controller whenever it receives a request to process a certain UI event.

To trick the connector tool you can call the UpdateMouseInfo method of the controller, prior to calling the connector Activate method. For example:


view.Controller.UpdateMouseInfo(new MouseEventArgs(MouseButtons.Left, 1, yourX, yourY, 0), MouseEvent.LeftButtonDown);

connectorTool.Activate();

Best regards,
Ivo