示例#1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="Eto.Forms.TableLayout"/> class with the specified rows.
 /// </summary>
 /// <param name="yscale">Scale all rows</param>
 /// <param name="rows">Rows to populate the table.</param>
 public TableLayout(bool yscale, params TableRow[] rows)
 {
     if (yscale)
     {
         foreach (TableRow row in rows)
         {
             if (row != null)
             {
                 row.ScaleHeight = true;
             }
         }
     }
     Rows = new TableRowCollection(this, rows);
     Create();
     Initialize();
 }
示例#2
0
 void SetCellSize(Size value, bool createRows)
 {
     if (created)
     {
         throw new InvalidOperationException(string.Format(CultureInfo.CurrentCulture, "Can only set the cell size of a table once"));
     }
     dimensions = value;
     Handler.CreateControl(dimensions.Width, dimensions.Height);
     if (!dimensions.IsEmpty)
     {
         if (createRows)
         {
             var rows = Enumerable.Range(0, value.Height).Select(r => new TableRow(Enumerable.Range(0, value.Width).Select(c => new TableCell())));
             Rows = new TableRowCollection(this, rows);
         }
     }
     created = true;
 }
示例#3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="Eto.Forms.TableLayout"/> class with the specified rows.
 /// </summary>
 /// <param name="rows">Rows to populate the table.</param>
 public TableLayout(IEnumerable <TableRow> rows)
 {
     Rows = new TableRowCollection(this, rows);
     Create();
     Initialize();
 }
示例#4
0
 /// <summary>
 /// Initializes a new instance of the <see cref="Eto.Forms.TableLayout"/> class with the specified rows.
 /// </summary>
 /// <param name="rows">Rows to populate the table.</param>
 public TableLayout(params TableRow[] rows)
 {
     Rows = new TableRowCollection(this, rows);
     Create();
     Initialize();
 }