/// <summary> /// Calculates background drawing rect, rectangle can reside out of clipping area /// </summary> /// <param name="aArea"> /// Area <see cref="Cairo.Rectangle"/> /// </param> /// <returns> /// Result rectangle <see cref="Cairo.Rectangle"/> /// </returns> public override CellRectangle CalculateBackgroundRect(CellRectangle aArea) { int x, y, r, b; x = y = r = b = 0; ResolveStyle(); DrawingCellHelper.GetCutSideBorderThickness(Style, SideCut, out x, out y, out r, out b); FreeStyle(); return(new CellRectangle(aArea.X - x, aArea.Y - y, aArea.Width + r + x, aArea.Height + b + y)); }
/// <summary> /// Resolves size needed for cell /// </summary> /// <param name="aWidth"> /// Cell width <see cref="System.Double"/> /// </param> /// <param name="aHeight"> /// Cell height <see cref="System.Double"/> /// </param> public override void GetCellSize(out double aWidth, out double aHeight) { base.GetCellSize(out aWidth, out aHeight); int xThick, yThick, rThick, bThick; xThick = yThick = rThick = bThick = 0; ResolveStyle(); DrawingCellHelper.GetBorderThickness(Style, SideCut, out xThick, out yThick, out rThick, out bThick); FreeStyle(); aWidth += xThick + rThick; aHeight += yThick + bThick; }
/* protected override CellRectangle GetPaintableArea() * { * CellRectangle rct = new CellRectangle (Area.X+Padding, Area.Y+Padding, Area.Width-(Padding*2), Area.Height-(Padding*2)); * int x,y,r,b; * x = y = r = b = 0; * if (Style != null) * // DrawingCellHelper.GetSideBorderThickness (Style, SideCut, out x, out y, out r, out b); * DrawingCellHelper.GetBorderThickness (Style, SideCut, out x, out y, out r, out b); * FreeStyle(); * rct.X += x; * rct.Y += y; * rct.Width -= r+x; * rct.Height -= b+y; * System.Console.WriteLine("x,y,r,b: {0},{1},{2},{3}", x,y,r,b); * // return (new Cairo.Rectangle (rct.X, rct.Y, rct.Width-(r+x), rct.Height-(b+y))); * return (rct); * }*/ protected override CellRectangle GetChildArea() { CellRectangle rct = base.GetChildArea(); //new CellRectangle (Area.X+Padding, Area.Y+Padding, Area.Width-(Padding*2), Area.Height-(Padding*2)); int x, y, r, b; x = y = r = b = 0; ResolveStyle(); DrawingCellHelper.GetBorderThickness(Style, SideCut, out x, out y, out r, out b); FreeStyle(); rct.X += x; rct.Y += y; rct.Width -= r + x; rct.Height -= b + y; // System.Console.WriteLine("x,y,r,b: {0},{1},{2},{3}", x,y,r,b); // return (new Cairo.Rectangle (rct.X, rct.Y, rct.Width-(r+x), rct.Height-(b+y))); return(rct); }
/// <summary> /// Calculates cell areas /// </summary> /// <param name="aRect"> /// Bounding rectangle <see cref="CellRectangle"/> /// </param> protected override void CalculateCellAreas(CellRectangle aRect) { DrawingCellHelper.HBoxCalculateCellAreas(this, aRect); }
/// <summary> /// Calculates container size /// </summary> /// <param name="aWidth"> /// Cell width <see cref="System.Double"/> /// </param> /// <param name="aHeight"> /// Cell height <see cref="System.Double"/> /// </param> public override void GetSize(out double aWidth, out double aHeight) { DrawingCellHelper.HBoxGetSize(this, out aWidth, out aHeight); }