public virtual CellAreaDim PreferredLayoutSize(CompositeCellAreaComponent target) { CellAreaDim dim = new CellAreaDim(); foreach (CellAreaComponent comp in target.GetComponents()) { if (comp.IsVisible()) { CellAreaDim d = comp.GetPreferredSize(); dim.width += d.width + hgap; dim.height = System.Math.Max(d.height, dim.height); } } // Insets insets = target.insets(); // dim.width += insets.left + insets.right; // dim.height += insets.top + insets.bottom; return dim; }
public virtual CellAreaDim PreferredLayoutSize(CompositeCellAreaComponent target) { CellAreaDim dim = new CellAreaDim(0, 0); CellAreaComponent c = null; if ((c = GetChild(EAST)) != null) { CellAreaDim d = c.GetPreferredSize(); dim.width += d.width + hgap; dim.height = System.Math.Max(d.height, dim.height); } if ((c = GetChild(WEST)) != null) { CellAreaDim d = c.GetPreferredSize(); dim.width += d.width + hgap; dim.height = System.Math.Max(d.height, dim.height); } if ((c = GetChild(CENTER)) != null) { CellAreaDim d = c.GetPreferredSize(); dim.width += d.width; dim.height = System.Math.Max(d.height, dim.height); } if ((c = GetChild(NORTH)) != null) { CellAreaDim d = c.GetPreferredSize(); dim.width = System.Math.Max(d.width, dim.width); dim.height += d.height + vgap; } if ((c = GetChild(SOUTH)) != null) { CellAreaDim d = c.GetPreferredSize(); dim.width = System.Math.Max(d.width, dim.width); dim.height += d.height + vgap; } // Insets insets = target.getInsets(); // dim.width += insets.left + insets.right; // dim.height += insets.top + insets.bottom; return dim; }