示例#1
0
 /// <summary>
 /// Moves shapeToMove so that its topleft corner
 /// corresponds with the topleft corner of reference.
 /// </summary>
 /// <param name="reference"></param>
 /// <param name="shapeToMove"></param>
 public static void PutAtRight(
     IDrawableRect reference,
     IDrawableRect shapeToMove,
     int Margin)
 {
     shapeToMove.MoveTo(
         reference.Bounds.Location.X + Margin,
         reference.Bounds.Location.Y);
 }
示例#2
0
 /// <summary>
 /// Puts a shapeToMove to the right from reference.
 /// </summary>
 /// <param name="xreference"></param>
 /// <param name="yreference"></param>
 /// <param name="shapeToMove"></param>
 public static void PutRight(
     IDrawableRect xreference,
     IDrawableRect yreference,
     IDrawableRect shapeToMove,
     int Margin)
 {
     shapeToMove.MoveTo(
         xreference.Bounds.Right + 1 + Margin,
         yreference.Bounds.Location.Y
         );
 }
示例#3
0
 /// <summary>
 /// Moves a shapeToMove so that it is left-aligned with reference
 /// and is below it.
 /// </summary>
 /// <param name="reference"></param>
 /// <param name="shapeToMove"></param>
 public static void PutUnder(
     IDrawableRect reference,
     IDrawableRect shapeToMove,
     int Margin
     )
 {
     shapeToMove.MoveTo(
         reference.Bounds.Location.X,
         reference.Bounds.Bottom + 1 + Margin
         );
 }
示例#4
0
 /// <summary>
 /// Puts the shapeToMove under reference
 /// and "indent" pixels to the right
 /// </summary>
 /// <param name="reference"></param>
 /// <param name="shapeToMove"></param>
 /// <param name="indent"></param>
 public static void PutUnderAndIndent(
     IDrawableRect reference,
     IDrawableRect shapeToMove,
     int indent,
     int margin
     )
 {
     shapeToMove.MoveTo(
         reference.Bounds.Location.X + indent,
         reference.Bounds.Bottom + 1 + margin
         );
 }
示例#5
0
 public static void PutUnderAndIndentFrom(
     IDrawableRect xReference,
     IDrawableRect yReference,
     IDrawableRect shapeToMove,
     int indent,
     int margin
     )
 {
     shapeToMove.MoveTo(
         xReference.Bounds.Location.X + indent,
         yReference.Bounds.Bottom + margin
         );
 }
示例#6
0
        /// <summary>
        /// Resizes a shapeToResize to be a minimal rectangle
        /// which fully contains leftTopShape in the top left corner
        /// and fully contains bottomRightShape in the bottom right corner.
        /// </summary>
        public static void PutAround(
            IDrawableRect leftTopShape,
            IDrawableRect bottomRightShape,
            IDrawableRect shapeToResize,
            int xMargin,
            int yMargin
            )
        {
            shapeToResize.MoveTo(
                leftTopShape.Bounds.Location.X - xMargin,
                leftTopShape.Bounds.Location.Y - yMargin);

            shapeToResize.Bounds.Size.Set(
                bottomRightShape.Bounds.Right - leftTopShape.Bounds.Location.X + 2 * xMargin,
                bottomRightShape.Bounds.Bottom - leftTopShape.Bounds.Location.Y + 2 * yMargin
                );
        }
示例#7
0
        public static void PutUnderAndIndentFrom(
			IDrawableRect xReference,
			IDrawableRect yReference,
			IDrawableRect shapeToMove,
			int indent,
			int margin
		)
        {
            shapeToMove.MoveTo(
                xReference.Bounds.Location.X + indent,
                yReference.Bounds.Bottom + margin
            );
        }
示例#8
0
        /// <summary>
        /// Puts the shapeToMove under reference
        /// and "indent" pixels to the right
        /// </summary>
        /// <param name="reference"></param>
        /// <param name="shapeToMove"></param>
        /// <param name="indent"></param>
        public static void PutUnderAndIndent(
			IDrawableRect reference,
			IDrawableRect shapeToMove, 
			int indent,
			int margin
		)
        {
            shapeToMove.MoveTo(
                reference.Bounds.Location.X + indent,
                reference.Bounds.Bottom + 1 + margin
            );
        }
示例#9
0
        /// <summary>
        /// Moves a shapeToMove so that it is left-aligned with reference
        /// and is below it.
        /// </summary>
        /// <param name="xreference"></param>
        /// <param name="yreference"></param>
        /// <param name="shapeToMove"></param>
        public static void PutUnder(
			IDrawableRect xreference,
			IDrawableRect yreference,
			IDrawableRect shapeToMove,
            int Margin
        )
        {
            shapeToMove.MoveTo(
                xreference.Bounds.Location.X,
                yreference.Bounds.Bottom + 1 + Margin
            );
        }
示例#10
0
        /// <summary>
        /// Puts a shapeToMove to the right from reference.
        /// </summary>
        /// <param name="xreference"></param>
        /// <param name="yreference"></param>
        /// <param name="shapeToMove"></param>
        public static void PutRight(
			IDrawableRect xreference,
			IDrawableRect yreference,
			IDrawableRect shapeToMove,
            int Margin)
        {
            shapeToMove.MoveTo(
                xreference.Bounds.Right + 1 + Margin,
                yreference.Bounds.Location.Y
            );
        }
示例#11
0
        /// <summary>
        /// Moves shapeToMove so that its topleft corner
        /// corresponds with the topleft corner of reference.
        /// </summary>
        /// <param name="reference"></param>
        /// <param name="shapeToMove"></param>
        public static void PutAtRight(
			IDrawableRect reference,
			IDrawableRect shapeToMove,
            int Margin)
        {
            shapeToMove.MoveTo(
                reference.Bounds.Location.X + Margin,
                reference.Bounds.Location.Y);
        }
示例#12
0
        /// <summary>
        /// Resizes a shapeToResize to be a minimal rectangle
        /// which fully contains leftTopShape in the top left corner
        /// and fully contains bottomRightShape in the bottom right corner.
        /// </summary>
        public static void PutAround(
			IDrawableRect leftTopShape,
			IDrawableRect RightShape,
			IDrawableRect bottomShape,
			IDrawableRect shapeToResize,
            int xMargin,
            int yMargin
        )
        {
            shapeToResize.MoveTo(
                leftTopShape.Bounds.Location.X - xMargin,
                leftTopShape.Bounds.Location.Y - yMargin);

            shapeToResize.Bounds.Size.Set(
                RightShape.Bounds.Right - leftTopShape.Bounds.Location.X + 2 * xMargin,
                bottomShape.Bounds.Bottom - leftTopShape.Bounds.Location.Y + 2 * yMargin
            );
        }