.. default-domain:: c .. highlight:: c Layout ====== .. type:: krpc_UI_Layout_t Arranges the elements of a panel automatically, so that they do not have to be positioned one by one. See :func:`krpc_UI_Panel_AddHorizontalLayout`, :func:`krpc_UI_Panel_AddVerticalLayout` and :func:`krpc_UI_Panel_AddGridLayout`. .. function:: krpc_error_t krpc_UI_Layout_Spacing(krpc_connection_t connection, float * returnValue, krpc_UI_Layout_t instance) .. function:: krpc_error_t krpc_UI_Layout_set_Spacing(krpc_connection_t connection, krpc_UI_Layout_t instance, float value) The gap left between the elements, in pixels. A grid layout uses it in both directions. .. function:: krpc_error_t krpc_UI_Layout_Padding(krpc_connection_t connection, krpc_UI_Padding_t * returnValue, krpc_UI_Layout_t instance) .. function:: krpc_error_t krpc_UI_Layout_set_Padding(krpc_connection_t connection, krpc_UI_Layout_t instance, const krpc_UI_Padding_t * value) The gap left inside the edges of the panel. .. function:: krpc_error_t krpc_UI_Layout_ChildAlignment(krpc_connection_t connection, krpc_UI_TextAnchor_t * returnValue, krpc_UI_Layout_t instance) .. function:: krpc_error_t krpc_UI_Layout_set_ChildAlignment(krpc_connection_t connection, krpc_UI_Layout_t instance, krpc_UI_TextAnchor_t value) Where the elements are placed within the space the layout has to fill. .. function:: krpc_error_t krpc_UI_Layout_CellSize(krpc_connection_t connection, krpc_tuple_double_double_t * returnValue, krpc_UI_Layout_t instance) .. function:: krpc_error_t krpc_UI_Layout_set_CellSize(krpc_connection_t connection, krpc_UI_Layout_t instance, const krpc_tuple_double_double_t * value) The size of each cell of a grid layout, in pixels. .. note:: Only applies to a grid layout. Throws an exception for the other layouts, whose elements are sized individually using their layout elements. .. function:: krpc_error_t krpc_UI_Layout_Constraint(krpc_connection_t connection, krpc_UI_GridConstraint_t * returnValue, krpc_UI_Layout_t instance) .. function:: krpc_error_t krpc_UI_Layout_set_Constraint(krpc_connection_t connection, krpc_UI_Layout_t instance, krpc_UI_GridConstraint_t value) What fixes the shape of a grid layout. .. note:: Only applies to a grid layout. Throws an exception for the other layouts. .. function:: krpc_error_t krpc_UI_Layout_ConstraintCount(krpc_connection_t connection, int32_t * returnValue, krpc_UI_Layout_t instance) .. function:: krpc_error_t krpc_UI_Layout_set_ConstraintCount(krpc_connection_t connection, krpc_UI_Layout_t instance, int32_t value) The number of columns or rows that :func:`krpc_UI_Layout_Constraint` fixes, ignored when the constraint is :macro:`KRPC_UI_GRIDCONSTRAINT_FLEXIBLE`. .. note:: Only applies to a grid layout. Throws an exception for the other layouts. .. type:: krpc_UI_Padding_t The gap left inside each edge of a layout, in whole pixels. .. note:: See :func:`krpc_UI_Layout_Padding`. .. member:: int32_t left The gap inside the left edge. .. member:: int32_t right The gap inside the right edge. .. member:: int32_t top The gap inside the top edge. .. member:: int32_t bottom The gap inside the bottom edge. .. type:: krpc_UI_GridConstraint_t What fixes the shape of a grid layout. .. macro:: KRPC_UI_GRIDCONSTRAINT_FLEXIBLE Fit as many columns and rows as the size of the panel allows. .. macro:: KRPC_UI_GRIDCONSTRAINT_FIXEDCOLUMNCOUNT Use a fixed number of columns, and as many rows as are needed. .. macro:: KRPC_UI_GRIDCONSTRAINT_FIXEDROWCOUNT Use a fixed number of rows, and as many columns as are needed.