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
|
I need to know on the diagram level if a connection is currently being drawn. Is there an easy way to do it? Thanx, Gili |
|
|
Hi Gili, Just to clarify, do you mean you want to know if a connection has been rendered and is displayed in the viewport? The closest you can get to this is is checking to see if the connection is within the ConnectionElements collection property of the DiagramSurface. Note that this returns all connection visuals that have been created, which will usually include connections that may be slightly outside the viewport. You could always iterate the segments and check that one of them truly is within the viewport if you need to though. Please let me know if I've misunderstood your question. -Jason Fauchelle |
|
|
No, what I mean is that i need to know if a connection is currently being dragged (yet to be dropped). You get me? Like when the user grabs a connection point and drags it to another connection point - i need to know if the user is currently dragging the connection... |
|
|
Thanks, I got it now. This can be done by listening to Thumb events. Here's an example of attaching a handler (where ds is a DiagramSurface instance):
And the handler:
The handler will be called by all types of thumbs - move, rotate, resize etc, so the handler includes a check for the type of thumb you're interested in - ConnectionPointThumb. This handler will be called every time the mouse is dragged. If you only need to know that a drag has started, you could use the DragStartedEvent instead. Hope that helps. Let me know if you have further questions here. -Jason Fauchelle |
|
|
Cool :-) I'll give it a try. |
|
|
Thanks! That worked well for me! |
|