/// <summary>
 /// Copy constructor used during layout expansion and page break handling.
 /// </summary>
 public TableCellLayout(TableCellLayout src)
     : base(src)
 {
     _style          = src._style;
     _colSpan        = src._colSpan;
     CalculatedWidth = src.CalculatedWidth;
 }
Пример #2
0
        private void RenderTableCell(TableCellLayout layout, ITableRow row)
        {
            ITableCell cell = row.AddCell(layout.ColumnSpan, (s.TableCellStyle)layout.Style, layout.TrackingInfo);

            foreach (Layout sublayout in layout.SubLayouts)
            {
                Render(sublayout, cell);
            }
        }
Пример #3
0
        private void RenderTableCellLayout(TableCellLayout layout, Page page)
        {
            TableCellStyle style = (TableCellStyle)layout.Style;

//			if(style.BackColor != null)
//				Fill(layout.Bounds, style., page); TODO: why doesn't TableCellStyle have BackColor?

            foreach (Layout child in layout.SubLayouts)
            {
                Render(child, page);
            }
        }
Пример #4
0
        public void AddPhoto(PhotoLayout photoLayout, TextLayout captionLayout)
        {
            TableCellLayout outer = new TableCellLayout(_generator, _trackingInfo.LineNumber, _trackingInfo.LinePosition, null);

            _photoRow.AddSubLayout(outer);
            outer.AddSubLayout(photoLayout);

            outer = new TableCellLayout(_generator, _trackingInfo.LineNumber, _trackingInfo.LinePosition, null);
            _captionRow.AddSubLayout(outer);
            outer.AddSubLayout(captionLayout);

            ++_numPhotos;
        }
Пример #5
0
        private void RenderPhotoRowLayout(PhotoRowLayout layout, Page page)
        {
            for (int x = 0; x < layout.NumPhotos; ++x)
            {
                //	There's always a photo...
                PhotoLayout photoCell = (PhotoLayout)layout.PhotoRow.GetSubLayoutAtIndex(x).GetSubLayoutAtIndex(0);
                RenderPhotoLayout(photoCell, page);

                //	but not always a caption
                TableCellLayout captionCell = (TableCellLayout)layout.CaptionRow.GetSubLayoutAtIndex(x);
                if (captionCell.NumSubLayouts > 0)
                {
                    TextLayout caption = (TextLayout)captionCell.GetSubLayoutAtIndex(0);
                    RenderTextLayout(caption, page);
                }
            }
        }
Пример #6
0
        public void SetColumnWidths(int[] widths)
        {
            _cellWidths = widths;

            GetCells();
            int columnIndex = 0;

            for (int cellIndex = 0; cellIndex < _cells.Count; ++cellIndex)
            {
                TableCellLayout cell = _cells[cellIndex];
                cell.CalculatedWidth = 0;
                for (int span = 0; span < cell.ColumnSpan; ++span)
                {
                    if (columnIndex >= _cellWidths.Length)
                    {
                        throw new ReportDesignException($"Too many table cells. Table defines {_cellWidths.Length} columns.", this);
                    }
                    cell.CalculatedWidth += _cellWidths[columnIndex++];
                }
            }
        }