/// <summary>
/// Draws a sample box.
/// </summary>
public void BeginBox(XGraphics gfx, int number)
{
//obracene XY
gfx.RotateAtTransform(90.0, new XPoint(height / 4, width / 4));
gfx.TranslateTransform(+62, +63);
//const int dEllipse = 15;
XRect rect = new XRect(0, 0, height /2 -2, width/2 -2);
if (number % 2 == 0)
rect.X += height/2 +2;
rect.Y = ((number - 1) / 2) * (-width/2 - 3);
//rect.Inflate(-10, -10);
//XRect rect2 = rect;
XPen pen = new XPen(XColors.Black, 1);
gfx.DrawRectangle(pen, rect.X, rect.Y, rect.Width, rect.Height);
//rect2.Offset(this.borderWidth, this.borderWidth);
//gfx.DrawRoundedRectangle(new XSolidBrush(this.shadowColor), rect2, new XSize(dEllipse + 8, dEllipse + 8));
//XLinearGradientBrush brush = new XLinearGradientBrush(rect, this.backColor, this.backColor2, XLinearGradientMode.Vertical);
//gfx.DrawRoundedRectangle(this.borderPen, brush, rect, new XSize(dEllipse, dEllipse));
//rect.Inflate(-5, -5);
//rect.Inflate(-10, -5);
//rect.Y += 20;
//rect.Height -= 20;
////gfx.DrawRectangle(XPens.Red, rect);
// gfx.TranslateTransform(rect.X, rect.Y);
this.state = gfx.Save();
}