Skip to main content

Class GridLayout

A layout that arranges child controls in a grid with alignment and spanning options.

Assembly: MicroLayout.dll
View Source
Declaration
public class GridLayout : MicroLayout, IThemedControl, IControl

Inheritance: System.Object -> Meadow.Foundation.Graphics.MicroLayout.Control

Implements:
Meadow.Foundation.Graphics.MicroLayout.IThemedControl

Properties

Padding

Gets or sets the padding (or indentation) of all controls from all 4 edges.

View Source
Declaration
public int Padding { get; set; }

RowSpacing

Gets or sets the spacing between rows.

View Source
Declaration
public int RowSpacing { get; set; }

ColumnSpacing

Gets or sets the spacing between columns.

View Source
Declaration
public int ColumnSpacing { get; set; }

Methods

Add(IControl, int, int, int, int, Alignment)

Adds a control to the grid at the specified position with optional spanning and alignment.

View Source
Declaration
public void Add(IControl control, int row, int col, int rowspan = 1, int colspan = 1, GridLayout.Alignment alignment = Alignment.Center)
Parameters
TypeNameDescription
Meadow.Foundation.Graphics.MicroLayout.IControlcontrolThe control to add.
System.Int32rowThe row index of the control.
System.Int32colThe column index of the control.
System.Int32rowspanThe number of rows the control spans.
System.Int32colspanThe number of columns the control spans.
Meadow.Foundation.Graphics.MicroLayout.GridLayout.AlignmentalignmentThe alignment of the control within the cell.

Remove(IControl)

Removes a control from the grid layout.

View Source
Declaration
public void Remove(IControl control)
Parameters
TypeNameDescription
Meadow.Foundation.Graphics.MicroLayout.IControlcontrolThe control to remove.

LayoutControls()

Updates the layout of all controls in the grid.

View Source
Declaration
public void LayoutControls()

OnDraw(MicroGraphics)

Draws the grid layout.

View Source
Declaration
protected override void OnDraw(MicroGraphics graphics)
Parameters
TypeName
Meadow.Foundation.Graphics.MicroGraphicsgraphics

Implements