示例#1
0
 /// <summary>
 /// This is called while the user is dragging the mouse and when the user releases the mouse.
 /// </summary>
 /// <param name="evttype">A value of <c>GoInputState.Start</c> when called from <see cref="M:Northwoods.Go.GoToolResizing.Start" />,
 /// a value of <c>GoInputState.Continue</c> when called from <see cref="M:Northwoods.Go.GoToolResizing.DoMouseMove" />, and
 /// a value of <c>GoInputState.Finish</c> when called from <see cref="M:Northwoods.Go.GoToolResizing.DoMouseUp" />.</param>
 /// <remarks>
 /// Basically this just calls <see cref="M:Northwoods.Go.GoObject.DoResize(Northwoods.Go.GoView,System.Drawing.RectangleF,System.Drawing.PointF,System.Int32,Northwoods.Go.GoInputState,System.Drawing.SizeF,System.Drawing.SizeF)" /> on the
 /// <see cref="P:Northwoods.Go.GoTool.CurrentObject" />.  Objects are responsible for their
 /// own resize behavior.
 /// However, this calls <see cref="M:Northwoods.Go.GoView.SnapPoint(System.Drawing.PointF,Northwoods.Go.GoObject)" /> to adjust the
 /// input event point to make sure the current resize point is a valid one
 /// according to whatever grids there are.
 /// </remarks>
 public virtual void DoResizing(GoInputState evttype)
 {
     if (base.CurrentObject != null)
     {
         GoInputEventArgs lastInput = base.LastInput;
         lastInput.DocPoint  = base.View.SnapPoint(lastInput.DocPoint, base.CurrentObject);
         lastInput.ViewPoint = base.View.ConvertDocToView(lastInput.DocPoint);
         GoObject   currentObject = base.CurrentObject;
         RectangleF bounds        = currentObject.Bounds;
         currentObject.DoResize(base.View, OriginalBounds, lastInput.DocPoint, ResizeHandle.HandleID, evttype, MinimumSize, MaximumSize);
         if (!mySelectionHidden && ((bounds == currentObject.Bounds && currentObject.Document == base.View.Document) || currentObject.View == base.View))
         {
             currentObject.AddSelectionHandles(base.Selection, mySelectedObject);
         }
     }
 }