Profile Picture

Node move event

Posted By Igor Yakubov 15 Years Ago
Author
Message
Igor Yakubov
Posted 15 Years Ago
View Quick Profile
Forum Newbie

Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)

Group: Forum Members
Last Active: 14 Years Ago
Posts: 7, Visits: 1

Is there is a way to receive event when the node is moving (like MouseMove event) ?

Also I need a way to know when some shape is move upon another shape (like drag and drop)?

Thanks.

 



Ivo Milanov
Posted 15 Years Ago
View Quick Profile
Forum Member

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
Last Active: 2 Months Ago
Posts: 35, Visits: 15
Hi Igor,

Although the NodeBoundsChanged event is not raised in the document for the shape being previewed, the same event NodeBoundsChanged is raised by the view event sink service when you drag the shape clone around. For speed optimizations you have to set the FireEvents property of the preview layer to true first.

Although the shape clone. which serves as preview is a different object than the shape being previewed, they will both have the same UniqueId. The following code captures the event and gets the original shape whose bounds are to be changed:

view.PreviewLayer.FireEvents = true;
view.EventSinkService.NodeBoundsChanged += new Nevron.Dom.NodeEventHandler(EventSinkService_NodeBoundsChanged);

void EventSinkService_NodeBoundsChanged(Nevron.Dom.NNodeEventArgs args)
{
NShape previewShape = args.Node as NShape;
if (previewShape == null)
return;

NShape orignalShape = (NShape)document.GetElementFromUniqueId(previewShape.UniqueId);
// previewShape.Bounds are the bounds of the preview
// orignalShape.Bounds are the current original shape bounds – they will be set to
// previewShape.Bounds once the user has finished moving the preview
}

Hope this helps – questions or comments – please feel free…

Best regards,
Ivo

Hamdy Ghanem
Posted 13 Years Ago
View Quick Profile
Forum Newbie

Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)

Group: Forum Members
Last Active: 13 Years Ago
Posts: 7, Visits: 1
How can I get the rotate value



Similar Topics


Reading This Topic