.. default-domain:: cs .. highlight:: csharp .. namespace:: KRPC.Client.Services.UI Layout ====== .. class:: Layout Arranges the elements of a panel automatically, so that they do not have to be positioned one by one. See :meth:`Panel.AddHorizontalLayout`, :meth:`Panel.AddVerticalLayout` and :meth:`Panel.AddGridLayout`. .. property:: float Spacing { get; set; } The gap left between the elements, in pixels. A grid layout uses it in both directions. :Game Scenes: All .. property:: Padding Padding { get; set; } The gap left inside the edges of the panel. :Game Scenes: All .. property:: TextAnchor ChildAlignment { get; set; } Where the elements are placed within the space the layout has to fill. :Game Scenes: All .. property:: System.Tuple CellSize { get; set; } The size of each cell of a grid layout, in pixels. :Game Scenes: All .. note:: Only applies to a grid layout. Throws an exception for the other layouts, whose elements are sized individually using their layout elements. .. property:: GridConstraint Constraint { get; set; } What fixes the shape of a grid layout. :Game Scenes: All .. note:: Only applies to a grid layout. Throws an exception for the other layouts. .. property:: int ConstraintCount { get; set; } The number of columns or rows that :prop:`Layout.Constraint` fixes, ignored when the constraint is :value:`GridConstraint.Flexible`. :Game Scenes: All .. note:: Only applies to a grid layout. Throws an exception for the other layouts. .. struct:: Padding The gap left inside each edge of a layout, in whole pixels. .. note:: See :prop:`Layout.Padding`. .. function:: Padding(int left, int right, int top, int bottom) Construct a Padding from the values of its fields. .. property:: int Left { get; } The gap inside the left edge. .. property:: int Right { get; } The gap inside the right edge. .. property:: int Top { get; } The gap inside the top edge. .. property:: int Bottom { get; } The gap inside the bottom edge. .. enum:: GridConstraint What fixes the shape of a grid layout. .. enumerator:: Flexible Fit as many columns and rows as the size of the panel allows. .. enumerator:: FixedColumnCount Use a fixed number of columns, and as many rows as are needed. .. enumerator:: FixedRowCount Use a fixed number of rows, and as many columns as are needed.