Inheritance: System.EventArgs
示例#1
0
		public void Start(Point mousePoint, OnElementResizingDelegate onElementResizingDelegate)
		{
			isResizing = false;

			if (resizeCtrl == null) return;

			this.onElementResizingDelegate = onElementResizingDelegate;

			resizeCtrl.OwnerElement.Invalidate();

			CornerPosition corPos = resizeCtrl.HitTestCorner(mousePoint);

			if (corPos != CornerPosition.Nothing)
			{
				//Events
				ElementEventArgs eventResizeArg = new ElementEventArgs(resizeCtrl.OwnerElement);
				onElementResizingDelegate(eventResizeArg);

				resizeCtrl.Start(mousePoint, corPos);

				UpdateResizeCorner();

				isResizing = true;
			}

		}
示例#2
0
		protected virtual void OnElementResized(ElementEventArgs e)
		{
			if (ElementResized != null)
			{
				ElementResized(this, e);
			}
		}
示例#3
0
		protected virtual void OnElementMoving(ElementEventArgs e)
		{
			if (ElementMoving != null)
			{
				ElementMoving(this, e);
			}
		}
示例#4
0
		protected virtual void OnElementClick(ElementEventArgs e)
		{
			if (ElementClick != null)
			{
				ElementClick(this, e);
			}
		}
示例#5
0
		protected override void OnMouseUp(MouseEventArgs e)
		{
			Rectangle selectionRectangle = selectionArea.GetUnsignedRectangle();
			
			if ((moveAction != null) && (moveAction.IsMoving))
			{
				ElementEventArgs eventClickArg = new ElementEventArgs(selectedElement);
				OnElementClick(eventClickArg);

				moveAction.End();
				moveAction = null;

				ElementMouseEventArgs eventMouseUpArg = new ElementMouseEventArgs(selectedElement, e.X, e.Y);
				OnElementMouseUp(eventMouseUpArg);
				
				if (changed)
					AddUndo();
			}

			// Select
			if (isMultiSelection)
			{
				EndSelectElements(selectionRectangle);
			}
			// Add element
			else if (isAddSelection)
			{
				EndAddElement(selectionRectangle);
			}
			
			// Add link
			else if (isAddLink)
			{
				Point mousePoint = Gsc2Goc(new Point(e.X, e.Y));
				EndAddLink();
				
				AddUndo();
			}
			
			// Resize
			if (resizeAction != null)
			{
				if (resizeAction.IsResizing)
				{
					Point mousePoint = Gsc2Goc(new Point(e.X, e.Y));
					resizeAction.End(mousePoint);
				
					AddUndo();
				}
				resizeAction.UpdateResizeCorner();
			}

			RestartInitValues();

			base.Invalidate();

			base.OnMouseUp (e);
		}
示例#6
0
		public void Resize(Point dragPoint)
		{
			if ((resizeCtrl != null) && (resizeCtrl.CanResize))
			{				
				//Events
				ElementEventArgs eventResizeArg = new ElementEventArgs(resizeCtrl.OwnerElement);
				onElementResizingDelegate(eventResizeArg);

				resizeCtrl.OwnerElement.Invalidate();

				resizeCtrl.Resize(dragPoint);

				ILabelController lblCtrl = ControllerHelper.GetLabelController(resizeCtrl.OwnerElement);
				if (lblCtrl != null)
					lblCtrl.SetLabelPosition();
				else
				{
					if (resizeCtrl.OwnerElement is ILabelElement)
					{
						LabelElement label = ((ILabelElement) resizeCtrl.OwnerElement).Label;
						label.PositionBySite(resizeCtrl.OwnerElement);
					}
				}

				UpdateResizeCorner();
			}
		}
示例#7
0
		public void End(Point posEnd)
		{
			if (resizeCtrl != null)
			{
				resizeCtrl.OwnerElement.Invalidate();

				resizeCtrl.End(posEnd);

				//Events
				ElementEventArgs eventResizeArg = new ElementEventArgs(resizeCtrl.OwnerElement);
				onElementResizingDelegate(eventResizeArg);

				isResizing = false;
			}
		}
示例#8
0
 private void designer1_ElementResizing(object sender, ElementEventArgs e)
 {
     AppendLog("designer1_ElementResizing: {0}", e.ToString());
 }
 private void designer1_ElementResizing(object sender, ElementEventArgs e)
 {
     if (designer1.Document.SelectedElements[0].GetType() == typeof(MFRectangleNode))
     {
         MFRectangleNode rn = (MFRectangleNode)e.Element;
         rn.Label.Location = rn.Location;
         rn.Label.Size = rn.Size;
     }
 }