/// <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); }
/// <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 RaiseNeedRedraw(IDrawableRect ShapeToRedraw) { if (NeedRedraw != null) { NeedRedraw(ShapeToRedraw); } }
/// <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); }
/// <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); }
/// <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); }
public void Redraw(IDrawableRect ShapeToRedraw) { if (RegionRepaint != null) { RegionRepaint(Renderer, ShapeToRedraw); } // finally, copy the buffer to the screen Renderer.RenderBuffer(this, ShapeToRedraw.Bounds); }
/// <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 ); }
/// <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 ); }
/// <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 ); }
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 ); }
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; }
/// <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 ); }
/// <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; } }
protected void HScroll_NeedRedraw(IDrawableRect ShapeToRedraw) { RaiseNeedRedraw(); }
public DrawHandlerEventArgs(IRenderer renderer, IDrawableRect shape) { Renderer = renderer; Shape = shape; }
private void Content_NeedRedraw(IDrawableRect ShapeToRedraw) { RaiseNeedRedraw(this); }
protected void VScroll_NeedRedraw(IDrawableRect ShapeToRedraw) { RaiseNeedRedraw(); }
protected void item_NeedRedraw(IDrawableRect ShapeToRedraw) { RaiseNeedRedraw(ShapeToRedraw); }
protected void mMainShape_NeedRedraw(IDrawableRect ShapeToRedraw) { Redraw(); }
/// <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 ); }
/// <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 ); }