Пример #1
0
        public PointF TransToGlobalPoint(PointF pt)
        {
            RectangleF rect;
            float      x = pt.X, y = pt.Y;
            CellCoord  inCellCoord = inParentCellCoord;

            x += tbPos.X;
            y += tbPos.Y;

            for (TableEx tb = parentTable; tb != null; tb = tb.parentTable)
            {
                rect        = tb.GetCellContentRect(inCellCoord.rowIdx, inCellCoord.colIdx);
                x          += rect.X + tb.tbPos.X;
                y          += rect.Y + tb.tbPos.Y;
                inCellCoord = tb.inParentCellCoord;
            }

            return(new PointF(x, y));
        }
Пример #2
0
        public RectangleF TransToGlobalRect(RectangleF rect)
        {
            RectangleF r;
            CellCoord  inCellCoord = inParentCellCoord;
            float      x = rect.X, y = rect.Y;

            x += tbPos.X;
            y += tbPos.Y;

            for (TableEx tb = parentTable; tb != null; tb = tb.parentTable)
            {
                r           = tb.GetCellContentRect(inCellCoord.rowIdx, inCellCoord.colIdx);
                x          += r.X + tb.tbPos.X;
                y          += r.Y + tb.tbPos.Y;
                inCellCoord = tb.inParentCellCoord;
            }

            RectangleF dstRect = new RectangleF(x, y, rect.Width, rect.Height);

            return(dstRect);
        }
Пример #3
0
        public void AddCellChildTable(int rowIdx, int colIdx, TableEx childTable)
        {
            CellValueInfo cellValueInfo;

            cellValueInfo       = new CellValueInfo();
            cellValueInfo.type  = CellValueType.Table;
            cellValueInfo.value = childTable;

            string key = GetRowColKey(rowIdx, colIdx);

            if (cellValueInfoDict.ContainsKey(key) == false)
            {
                cellValueInfoDict.Add(key, cellValueInfo);
            }
            else
            {
                cellValueInfoDict[key] = cellValueInfo;
            }

            childTable.parentTable       = this;
            childTable.inParentCellCoord = new CellCoord(rowIdx, colIdx);
        }
Пример #4
0
 public void SetTable(TableEx table)
 {
     rootTable = table;
 }