Layout Columns and Rows
PBLayoutElementFlags
Enumeration/bitset of type uint32_t:
Constants
PBLayoutElement_DRAW_BORDER_OUTSIDE
PBLayoutElement_DRAW_BORDER_OUTSIDE = 1<<0
Or any of the values from PBElementFlags.
PBLayoutColumnCreate
Function: Create a vertical column of elements.
Syntax (C/C++)
PBElementPtr _Nullable PBLayoutColumnCreate(PBElementRef parent,
PBLayoutElementFlags flags, int32_t gapDp, PBRectangle insetsDp);
Syntax (Python)
LayoutColumnCreate(parent, flags, gapDp, insetsDp) -> (column)
Parameters and Return Values
[in] parent (referenced PBElement): The parent element.
[in] flags (PBLayoutElementFlags): The element flags.
[in] gapDp (int32_t
): The spacing between child elements, in dps.
[in] insetsDp (PBRectangle): The spacing between the edges of this element and the edges of the rectangle into which the children are placed, in dps.
[out] column (nullable owned PBElement): The column element, or null on failure.
Discussion
This is a convenience function that creates an element and sets its layout metrics and style.
See PBElementCreate for a more detailed description of element creation.
Example (C/C++)
PBElement *column = PBLayoutColumnAdd((PBElement *) window, 0, 10, PB_RECT_1(10));
PBAssert(column); // Abort if memory couldn't be allocated.
PBButtonAdd(column, 0, PB_STR("Top Button"))
PBButtonAdd(column, 0, PB_STR("Middle Button"))
PBButtonAdd(column, 0, PB_STR("Bottom Button"))
See Also
PBLayoutRowCreate
Function: Create a horizontal row of elements.
Syntax (C/C++)
PBElementPtr _Nullable PBLayoutRowCreate(PBElementRef parent,
PBLayoutElementFlags flags, int32_t gapDp, PBRectangle insetsDp);
Syntax (Python)
LayoutRowCreate(parent, flags, gapDp, insetsDp) -> (row)
Parameters and Return Values
[in] parent (referenced PBElement): The parent element.
[in] flags (PBLayoutElementFlags): The element flags.
[in] gapDp (int32_t
): The spacing between child elements, in dps.
[in] insetsDp (PBRectangle): The spacing between the edges of this element and the edges of the rectangle into which the children are placed, in dps.
[out] row (nullable owned PBElement): The row element, or null on failure.
Discussion
This is a convenience function that creates an element and sets its layout metrics and style.
See PBElementCreate for a more detailed description of element creation.
Example (C/C++)
PBElement *row = PBLayoutRowAdd((PBElement *) window, 0, 10, PB_RECT_1(10));
PBAssert(row); // Abort if memory couldn't be allocated.
PBButtonAdd(row, 0, PB_STR("Left Button"))
PBButtonAdd(row, 0, PB_STR("Middle Button"))
PBButtonAdd(row, 0, PB_STR("Right Button"))