Exemple #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);
        }
Exemple #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);
 }
Exemple #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);
 }
Exemple #4
0
 public void RaiseNeedRedraw(IDrawableRect ShapeToRedraw)
 {
     if (NeedRedraw != null)
     {
         NeedRedraw(ShapeToRedraw);
     }
 }
Exemple #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);
 }
Exemple #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);
 }
Exemple #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);
 }
Exemple #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);
        }
Exemple #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
         );
 }
Exemple #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
         );
 }
Exemple #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
         );
 }
Exemple #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
         );
 }
Exemple #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;
        }
Exemple #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
                );
        }
Exemple #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;
     }
 }
Exemple #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;
            }
        }
Exemple #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);
        }
        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();
 }
Exemple #20
0
 public DrawHandlerEventArgs(IRenderer renderer, IDrawableRect shape)
 {
     Renderer = renderer;
     Shape    = shape;
 }
Exemple #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);
        }
Exemple #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
            );
        }
Exemple #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
            );
        }
 private void Content_NeedRedraw(IDrawableRect ShapeToRedraw)
 {
     RaiseNeedRedraw(this);
 }
Exemple #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);
        }
Exemple #26
0
 private void Content_NeedRedraw(IDrawableRect ShapeToRedraw)
 {
     RaiseNeedRedraw(this);
 }
 protected void VScroll_NeedRedraw(IDrawableRect ShapeToRedraw)
 {
     RaiseNeedRedraw();
 }
Exemple #28
0
 protected void item_NeedRedraw(IDrawableRect ShapeToRedraw)
 {
     RaiseNeedRedraw(ShapeToRedraw);
 }
Exemple #29
0
 protected void mMainShape_NeedRedraw(IDrawableRect ShapeToRedraw)
 {
     Redraw();
 }
Exemple #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
            );
        }
Exemple #31
0
 public DrawHandlerEventArgs(IRenderer renderer, IDrawableRect shape)
 {
     Renderer = renderer;
     Shape = shape;
 }
Exemple #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
            );
        }
Exemple #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);
        }
Exemple #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);
        }
Exemple #35
0
 public void RaiseNeedRedraw(IDrawableRect ShapeToRedraw)
 {
     if (NeedRedraw != null)
     {
         NeedRedraw(ShapeToRedraw);
     }
 }
Exemple #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
            );
        }