Example #1
0
        public override void Draw(DrawContext dc, int x, int y, Style c)
        {
            if (y + Height < dc.ClippingRectangle.Top)
            {
                // we're not visible
                return;
            }

//			int count=this.ElementNode.ChildNodes.Count;

            dc.Graphics.PushFont(dc.Graphics.GetFontHandle(c.FontDesc));

            startTag.Draw(dc, x, y, startTag.Ascent, startTag.Height, style);

            // TODO: H: invalid stylesheet can cause errors, ie. if cell/row defined without
            //			parent table

            // lines are actually our cells
            int pos = x + startTag.Width;

            foreach (TableCell cell in cells)
            {
                cell.Draw(dc, pos, y, c);

                int cellWidth = ParentTable[cell.ElementNode].Column.Width;
//				int minWidth=ParentTable[cell.ElementNode].Column.MinimumWidth;

                Rectangle rc = new Rectangle(pos, y, cellWidth, Height);
                rc.Offset(dc.Origin);
                dc.Graphics.FGraphics.DrawRectangle(Pens.LightGray, rc);

//				rc.Width=minWidth;
//				dc.Graphics.FGraphics.DrawRectangle(new Pen(Color.Blue, 2), rc);

                pos += cellWidth;
            }

            endTag.Draw(dc, pos, y, endTag.Ascent, endTag.Height, style);

//			Rectangle rc2=GetBoundingRect(x, y);
//			rc2.Offset(dc.Origin);
//			rc2.Width=MinimumWidth;
//			dc.Graphics.FGraphics.DrawRectangle(new Pen(Color.Cyan, 3), rc2);

//			dc.Graphics.FGraphics.DrawLine(Pens.LightGray,
//				rc.Location, new Point(rc.Right, rc.Top));
//			dc.Graphics.FGraphics.DrawLine(Pens.LightGray,
//				new Point(rc.Left, rc.Bottom), new Point(rc.Right, rc.Bottom));

            dc.Graphics.PopFont();
        }