GetDeltaRelativeTo() public method

Return the delta between the last and current mouse positions relative to a given node on the pick path.
public GetDeltaRelativeTo ( PNode nodeOnPath ) : SizeF
nodeOnPath PNode /// The returned delta will be in the local coordinate system of this node. ///
return System.Drawing.SizeF
		protected void aNode_MouseDrag(object sender, PInputEventArgs e) {
			PNode aNode = (PNode)sender;
			SizeF delta = e.GetDeltaRelativeTo(aNode);
			aNode.TranslateBy(delta.Width, delta.Height);
			PrintEventCoords(e);
			e.Handled = true;
		}
Esempio n. 2
0
 /// <summary>
 /// When the user drags with both mouse actual, move the document
 /// </summary>
 public override void OnMouseDrag(object sender, PInputEventArgs e)
 {
     PNode aNode = (PNode)sender;
     SizeF delta = e.GetDeltaRelativeTo(aNode);
     aNode.TranslateBy(delta.Width, delta.Height);
     aNode.MoveToFront();
 }
        /// <summary>
        /// Overridden.  See <see cref="PDragSequenceEventHandler.OnDrag">
        /// PDragSequenceEventHandler.OnDrag</see>.
        /// </summary>
        protected override void OnDrag(object sender, PInputEventArgs e)
        {
            base.OnDrag(sender, e);
            SizeF s = e.GetDeltaRelativeTo(draggedNode);

            s = draggedNode.LocalToParent(s);
            draggedNode.OffsetBy(s.Width, s.Height);
        }
Esempio n. 4
0
			/// <summary>
			/// Overridden.  See <see cref="PDragSequenceEventHandler.OnDrag">
			/// PDragSequenceEventHandler.OnDrag</see>.
			/// </summary>
			protected override void OnDrag(object sender, PInputEventArgs e) {
				base.OnDrag (sender, e);
				SizeF aDelta = e.GetDeltaRelativeTo(handle); 	
				if (aDelta.Width != 0 || aDelta.Height != 0) {
					handle.OnHandleDrag(sender, aDelta, e);
				}
			}
		/// <summary>
		/// Overridden.  See <see cref="PDragSequenceEventHandler.OnDrag">
		/// PDragSequenceEventHandler.OnDrag</see>.
		/// </summary>
		protected override void OnDrag(object sender, PInputEventArgs e) {
			base.OnDrag(sender, e);
			SizeF s = e.GetDeltaRelativeTo(draggedNode);
			s = draggedNode.LocalToParent(s);
			draggedNode.OffsetBy(s.Width, s.Height);
		}