Size Constraint Panels
PBSizeConstraintPanel
Opaque object handle: An element used to wrap another element, constraining its dimensions used for automatic layout.
This is a subclass of PBElement. You can safely cast from PBSizeConstraintPanel to PBElement. To cast from PBElement to PBSizeConstraintPanel, call PBSizeConstraintPanelCast; this performs a runtime assertion to check the cast is possible. This function is thread-safe.
This object maintains an internal reference count. When the reference count reaches zero, the object will be automatically deallocated. To increment the reference count, call PBElementRetain; to decrement the reference count, call PBElementRelease. These functions are thread-safe.
PBSizeConstraintPanelFlags
Enumeration/bitset of type uint32_t: Flags controlling the behavior and appearance of a size constraint panel.
Constants
Or any of the values from PBElementFlags.
PBSizeConstraintPanelCreate
Function: Create a size constraint panel UI element.
Syntax (C/C++)
PBSizeConstraintPanelPtr _Nullable PBSizeConstraintPanelCreate(
PBElementRef parent, PBSizeConstraintPanelFlags flags, int32_t minimumWidthDp,
int32_t maximumWidthDp, int32_t minimumHeightDp, int32_t maximumHeightDp);
Syntax (Python)
SizeConstraintPanelCreate(parent, flags, minimumWidthDp, maximumWidthDp, minimumHeightDp, maximumHeightDp) -> (panel)
Parameters and Return Values
[in] parent (referenced PBElement): The parent element.
[in] flags (PBSizeConstraintPanelFlags): Flags bitwise OR-ed together controlling the behavior and appearance of the element. The alignment flags (prefixed with PBElement_ALIGN_) apply to the constraint panel itself, not its child element. The flag PBElement_CUSTOM_LAYOUT is automatically added.
[in] minimumWidthDp (int32_t
): The minimum width of the content in dps. Pass -1 for no minimum width.
[in] maximumWidthDp (int32_t
): The maximum width of the content in dps. Pass -1 for no maximum width.
[in] minimumHeightDp (int32_t
): Same as the minimum width parameter, but for the height.
[in] maximumHeightDp (int32_t
): Same as the maximum width parameter, but for the height.
[out] panel (nullable owned PBSizeConstraintPanel): The created element, or null on failure.
Discussion
Exactly one child element should be added to the constraint panel.
The constraint panel ignores any metrics set with PBElementSetCustomStyle.
See PBElementCreate for a more detailed description of element creation.