Ejemplo n.º 1
0
        public static void DrawTable(int x, int y, Table.Table table)
        {
            table._validate();

            var width  = table.Dimensions.Width;
            var height = table.Dimensions.Height;
            var buffer = new Node[height, width];
            putFrameIntoBuffer(buffer, new Rect(0, 0, width-1 , height-1), table.Borders, table.BorderColors, table.FillColors);

            foreach (var cell in table.Cells)
            {
                putFrameIntoBuffer(buffer, cell.Dimensions, cell.Borders, cell.BorderColors, cell.FillColors);
            }

            var newBuffer = new ZCharInfo[height,width];

            for (var i = 0; i < height; i++)
            {
                for (var j = 0; j < width; j++)
                {
                    var charInfo = buffer[i, j];

                    newBuffer[i,j] = new ZCharInfo(
                        Tools.Get_Ascii_Byte(frameChars[charInfo.NodeEnumItem]),
                        new ZCharAttribute(charInfo.Colors.ForeColor, charInfo.Colors.BackColor));
                }
            }

            ZBuffer.SaveBuffer("TableBuffer", newBuffer);
            ZBuffer.WriteBuffer("TableBuffer", x, y);
        }