Esempio n. 1
0
        /// <summary>
        /// Increases size of shapeToResize,
        /// so that its right edge and bottom contain containedShape
        /// </summary>
        /// <param name="shapeToResize">The shape the size of which to increased.</param>
        /// <param name="containedShape">The shape to embrace.</param>
        public static void GrowToInclude(
			IDrawableRect shapeToResize,
			IDrawableRect containedShape
		)
        {
            GrowToInclude(shapeToResize, containedShape, 0, 0);
        }
Esempio n. 2
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
     )
 {
     PutUnder(reference, shapeToMove, 0);
 }
Esempio n. 3
0
 /// <summary>
 /// Increases size of shapeToResize,
 /// so that its right edge and bottom contain containedShape
 /// </summary>
 /// <param name="shapeToResize">The shape the size of which to increased.</param>
 /// <param name="containedShape">The shape to embrace.</param>
 public static void GrowToInclude(
     IDrawableRect shapeToResize,
     IDrawableRect containedShape
     )
 {
     GrowToInclude(shapeToResize, containedShape, 0, 0);
 }
Esempio n. 4
0
 public void RaiseNeedRedraw(IDrawableRect ShapeToRedraw)
 {
     if (NeedRedraw != null)
     {
         NeedRedraw(ShapeToRedraw);
     }
 }
Esempio n. 5
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
     )
 {
     PutAround(leftTopShape, bottomRightShape, shapeToResize, 0, 0);
 }
Esempio n. 6
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
     )
 {
     PutUnderAndIndent(reference, shapeToMove, indent, 0);
 }
Esempio n. 7
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);
 }
Esempio n. 8
0
        public void Redraw(IDrawableRect ShapeToRedraw)
        {
            if (RegionRepaint != null)
            {
                RegionRepaint(Renderer, ShapeToRedraw);
            }

            // finally, copy the buffer to the screen
            Renderer.RenderBuffer(this, ShapeToRedraw.Bounds);
        }
Esempio n. 9
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
         );
 }
Esempio n. 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
         );
 }
Esempio n. 11
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
         );
 }
Esempio n. 12
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
         );
 }
Esempio n. 13
0
        public void DrawShape(IRenderer Renderer, IDrawableRect ShapeToDraw)
        {
            // Substitute the Renderer'child DrawOperations with our own,
            // smart, coordinate translating DrawOperations
            // (Scroller : TranslateTransform : DrawOperations)
            Scroller.SourceDrawOperations = Renderer.DrawOperations;
            Renderer.DrawOperations       = Scroller;

            // Draw on modified Renderer:
            // all coordinates are recalculated while drawing
            ShapeToDraw.Draw(Renderer);

            // restore the Renderer's child default DrawOperations
            Renderer.DrawOperations = Scroller.SourceDrawOperations;
        }
Esempio n. 14
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
                );
        }
Esempio n. 15
0
 /// <summary>
 /// Increases size of shapeToResize,
 /// so that its right edge and bottom contain containedShape
 /// </summary>
 /// <param name="shapeToResize">The shape the size of which to increased.</param>
 /// <param name="containedShape">The shape to embrace.</param>
 /// <param name="xMargin">x-Distance between edges of shapes.</param>
 /// <param name="yMargin">y-Distance between edges of shapes.</param>
 public static void GrowToInclude(
     IDrawableRect shapeToResize,
     IDrawableRect containedShape,
     int xMargin,
     int yMargin
     )
 {
     if (containedShape.Bounds.Bottom + yMargin > shapeToResize.Bounds.Bottom)
     {
         shapeToResize.Bounds.Size.Y =
             containedShape.Bounds.Bottom + yMargin -
             shapeToResize.Bounds.Location.Y;
     }
     if (containedShape.Bounds.Right + xMargin > shapeToResize.Bounds.Right)
     {
         shapeToResize.Bounds.Size.X =
             containedShape.Bounds.Right + xMargin -
             shapeToResize.Bounds.Location.X;
     }
 }
Esempio n. 16
0
        /// <summary>
        /// Increases size of shapeToResize,
        /// so that its right edge and bottom contain containedShape
        /// </summary>
        /// <param name="shapeToResize">The shape the size of which to increased.</param>
        /// <param name="containedShape">The shape to embrace.</param>
        /// <param name="xMargin">x-Distance between edges of shapes.</param>
        /// <param name="yMargin">y-Distance between edges of shapes.</param>
        public static void GrowToInclude(
			IDrawableRect shapeToResize,
			IDrawableRect containedShape,
			int xMargin,
			int yMargin
		)
        {
            if (containedShape.Bounds.Bottom + yMargin > shapeToResize.Bounds.Bottom)
            {
                shapeToResize.Bounds.Size.Y =
                    containedShape.Bounds.Bottom + yMargin -
                    shapeToResize.Bounds.Location.Y;
            }
            if (containedShape.Bounds.Right + xMargin > shapeToResize.Bounds.Right)
            {
                shapeToResize.Bounds.Size.X =
                    containedShape.Bounds.Right + xMargin -
                    shapeToResize.Bounds.Location.X;
            }
        }
Esempio n. 17
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
		)
        {
            PutUnder(reference, shapeToMove, 0);
        }
Esempio n. 18
0
        public void DrawShape(IRenderer Renderer, IDrawableRect ShapeToDraw)
        {
            // Substitute the Renderer'child DrawOperations with our own,
            // smart, coordinate translating DrawOperations
            // (Scroller : TranslateTransform : DrawOperations)
            Scroller.SourceDrawOperations = Renderer.DrawOperations;
            Renderer.DrawOperations = Scroller;

            // Draw on modified Renderer:
            // all coordinates are recalculated while drawing
            ShapeToDraw.Draw(Renderer);

            // restore the Renderer's child default DrawOperations
            Renderer.DrawOperations = Scroller.SourceDrawOperations;
        }
 protected void HScroll_NeedRedraw(IDrawableRect ShapeToRedraw)
 {
     RaiseNeedRedraw();
 }
Esempio n. 20
0
 public DrawHandlerEventArgs(IRenderer renderer, IDrawableRect shape)
 {
     Renderer = renderer;
     Shape    = shape;
 }
Esempio n. 21
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
		)
        {
            PutAround(leftTopShape, bottomRightShape, shapeToResize, 0, 0);
        }
Esempio n. 22
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
            );
        }
Esempio n. 23
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
            );
        }
Esempio n. 24
0
 private void Content_NeedRedraw(IDrawableRect ShapeToRedraw)
 {
     RaiseNeedRedraw(this);
 }
Esempio n. 25
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
		)
        {
            PutUnderAndIndent(reference, shapeToMove, indent, 0);
        }
Esempio n. 26
0
 private void Content_NeedRedraw(IDrawableRect ShapeToRedraw)
 {
     RaiseNeedRedraw(this);
 }
Esempio n. 27
0
 protected void VScroll_NeedRedraw(IDrawableRect ShapeToRedraw)
 {
     RaiseNeedRedraw();
 }
Esempio n. 28
0
 protected void item_NeedRedraw(IDrawableRect ShapeToRedraw)
 {
     RaiseNeedRedraw(ShapeToRedraw);
 }
Esempio n. 29
0
 protected void mMainShape_NeedRedraw(IDrawableRect ShapeToRedraw)
 {
     Redraw();
 }
Esempio n. 30
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
            );
        }
Esempio n. 31
0
 public DrawHandlerEventArgs(IRenderer renderer, IDrawableRect shape)
 {
     Renderer = renderer;
     Shape = shape;
 }
Esempio n. 32
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
            );
        }
Esempio n. 33
0
        public void Redraw(IDrawableRect ShapeToRedraw)
        {
            if (RegionRepaint != null)
            {
                RegionRepaint(Renderer, ShapeToRedraw);
            }

            // finally, copy the buffer to the screen
            Renderer.RenderBuffer(this, ShapeToRedraw.Bounds);
        }
Esempio n. 34
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);
        }
Esempio n. 35
0
 public void RaiseNeedRedraw(IDrawableRect ShapeToRedraw)
 {
     if (NeedRedraw != null)
     {
         NeedRedraw(ShapeToRedraw);
     }
 }
Esempio n. 36
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
            );
        }