Connector tool.


Author
Message
michal bandrowski
michal bandrowski
Junior Member (10 reputation)Junior Member (10 reputation)Junior Member (10 reputation)Junior Member (10 reputation)Junior Member (10 reputation)Junior Member (10 reputation)Junior Member (10 reputation)Junior Member (10 reputation)Junior Member (10 reputation)
Group: Forum Members
Posts: 10, Visits: 1
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();
Ivo Milanov
Ivo Milanov
Forum Member (35 reputation)Forum Member (35 reputation)Forum Member (35 reputation)Forum Member (35 reputation)Forum Member (35 reputation)Forum Member (35 reputation)Forum Member (35 reputation)Forum Member (35 reputation)Forum Member (35 reputation)
Group: Forum Members
Posts: 35, Visits: 32

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


GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search