|
@@ -0,0 +1,56 @@
|
|
|
+using System;
|
|
|
+using System.Collections.Generic;
|
|
|
+using System.Text;
|
|
|
+
|
|
|
+namespace InABox.Core.DigitalForms.NewLayout
|
|
|
+{
|
|
|
+ public enum GridLayoutLengthType
|
|
|
+ {
|
|
|
+ Auto,
|
|
|
+ Star,
|
|
|
+ Value
|
|
|
+ }
|
|
|
+
|
|
|
+ public class GridLayoutLength
|
|
|
+ {
|
|
|
+ public static GridLayoutLength Auto => new GridLayoutLength(GridLayoutLengthType.Auto, 1);
|
|
|
+
|
|
|
+ public GridLayoutLengthType Type { get; set; }
|
|
|
+
|
|
|
+ public double Value { get; set; }
|
|
|
+
|
|
|
+ public GridLayoutLength(GridLayoutLengthType type, double value)
|
|
|
+ {
|
|
|
+ Type = type;
|
|
|
+ Value = value;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ public class FormControlGridCell
|
|
|
+ {
|
|
|
+ public int Row { get; set; } = 0;
|
|
|
+
|
|
|
+ public int RowSpan { get; set; } = 1;
|
|
|
+
|
|
|
+ public int Column { get; set; } = 0;
|
|
|
+
|
|
|
+ public int ColumnSpan { get; set; } = 1;
|
|
|
+
|
|
|
+ public Guid ControlID { get; set; }
|
|
|
+ }
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// A container control that lays its items out in a grid.
|
|
|
+ /// </summary>
|
|
|
+ /// <remarks>
|
|
|
+ /// Rows and columns begin counting at 0.
|
|
|
+ /// </remarks>
|
|
|
+ public class FormControlGrid : FormControl
|
|
|
+ {
|
|
|
+ public List<GridLayoutLength> RowLengths { get; set; } = new List<GridLayoutLength>();
|
|
|
+
|
|
|
+ public List<GridLayoutLength> ColumnLengths { get; set; } = new List<GridLayoutLength>();
|
|
|
+
|
|
|
+ public List<FormControlGridCell> Controls { get; set; } = new List<FormControlGridCell>();
|
|
|
+ }
|
|
|
+}
|