This thread looks to be a little on the old side and therefore may no longer be relevant. Please see if there is a newer thread on the subject and ensure you're using the most recent build of any software if your question regards a particular product.
This thread has been locked and is no longer accepting new posts, if you have a question regarding this topic please email us at support@mindscape.co.nz
|
Is there a way to accomplish the following: I have made a context menu that creates the node and connection, where I'm using FindMouseOverNodeElement to cast the connectionpoint, but I would very much like to have the above behavior instead. Thanks, Michael |
|
|
Hello Michael Start by adding a handler to the DiagramSurface to listen to Thumb drag-completed events:
Here is an example of what you could do in the handler. First check that e.OriginalSource is a ConnectionPointThumb, because this event can be triggered by all the different types of thumbs. Then we can combine the VerticalChange/HorizontalChange values with the position of the dragged connection point to find where the mouse was dropped. Then you can create a node centred at that position and then add a connection from the dragged point to the created node. (In this code I haven't done the connection part).
Then it's just a matter of setting a flag when the button is pressed to state that the cursor is "Charged" with an action. It may be best to change the mouse cursor too to indicate to the user what the button did. Jason Fauchelle |
|
|
Thanks very nice example :-) One little thing....... if I zoom in or out the insert point is not correct, it is okay if I'm not zooming. Thanks, Michael |
|
|
Good spotting, you'll want to use this code to get the offset values instead:
Jason Fauchelle |
|
|
Thanks :-) Michael |
|