Styling
PBAppearance
Opaque object handle: (not documented yet)
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 PBAppearanceRetain; to decrement the reference count, call PBAppearanceRelease. These functions are thread-safe.
PBStyleID
Enumeration/bitset of type uint32_t: (not documented yet)
Constants
PBStyleID_EMPTY
PBStyleID_EMPTY = 0
(not documented yet)
PBStyleID_ONE_LINE_INPUT
PBStyleID_ONE_LINE_INPUT = 21
(not documented yet)
PBStyleID_BORDER_OUTSIDE
PBStyleID_BORDER_OUTSIDE = 24
(not documented yet)
PBStyleID_TABLE_ITEM
PBStyleID_TABLE_ITEM = 38
(not documented yet)
PBStyleID_HORIZONTAL_SEPARATOR
PBStyleID_HORIZONTAL_SEPARATOR = 43
(not documented yet)
PBStyleID_CODE_BLOCK
PBStyleID_CODE_BLOCK = 47
(not documented yet)
PBStyleID_QUOTE_BLOCK
PBStyleID_QUOTE_BLOCK = 48
(not documented yet)
PBStyleID_HORIZONTAL_RULE
PBStyleID_HORIZONTAL_RULE = 49
(not documented yet)
PBStyleID_HORIZONTAL_LINE
PBStyleID_HORIZONTAL_LINE = 52
(not documented yet)
PBStyleID_PUSH_BUTTON_SMALL
PBStyleID_PUSH_BUTTON_SMALL = 53
(not documented yet)
PBStyleID_TAB_SWITCHER_BOTTOM
PBStyleID_TAB_SWITCHER_BOTTOM = 54
(not documented yet)
PBStyleID_DOCUMENT_TITLE
PBStyleID_DOCUMENT_TITLE = 55
(not documented yet)
PBStyleID_DOCUMENT_MARGIN
PBStyleID_DOCUMENT_MARGIN = 56
(not documented yet)
PBStyleID_VERTICAL_LINE
PBStyleID_VERTICAL_LINE = 57
(not documented yet)
PBCursorID
Enumeration/bitset of type uint8_t: (not documented yet)
Constants
PBCursorID_ARROW
PBCursorID_ARROW = 0
(not documented yet)
PBCursorID_IBEAM
PBCursorID_IBEAM = 1
(not documented yet)
PBCursorID_HIDDEN
PBCursorID_HIDDEN = 3
(not documented yet)
PBCursorID_SPLIT_HORIZONTAL
PBCursorID_SPLIT_HORIZONTAL = 4
(not documented yet)
PBCursorID_SPLIT_VERTICAL
PBCursorID_SPLIT_VERTICAL = 5
(not documented yet)
PBCursorID_HAND_POINT
PBCursorID_HAND_POINT = 6
(not documented yet)
PBLayoutMetricsFlags
Enumeration/bitset of type uint16_t: (not documented yet)
Constants
PBLayoutMetrics_WIDTH_EXACT
PBLayoutMetrics_WIDTH_EXACT = 1<<0
(not documented yet)
PBLayoutMetrics_HEIGHT_EXACT
PBLayoutMetrics_HEIGHT_EXACT = 1<<1
(not documented yet)
PBLayoutMetrics
Structure: The layout metrics of an element.
Fields
flags (PBLayoutMetricsFlags): Flags bitwise OR-ed together specifying additional options.
widthExact (int32_t
): The preferred width of the element to return from PBElementMeasure. Requires the PBLayoutMetrics_WIDTH_EXACT flag. Otherwise, the preferred width of the element is determined by the element's layout algorithm.
heightExact (int32_t
): The preferred height of the element to return from PBElementMeasure. Requires the PBLayoutMetrics_HEIGHT_EXACT flag. Otherwise, the preferred height of the element is determined by the element's layout algorithm.
gap (int32_t
): In the standard layout algorithm, this determines the spacing between each pair of adjacent child elements.
insets (PBRectangle): In the standard layout algorithms, this determines the minimum spacing between the edges of the element and its child elements.
See Also
PBElementSetStyle
Function: Set an element's style to a preset style.
Syntax (C/C++)
void PBElementSetStyle(PBElementRef element, PBStyleID styleID);
Syntax (Python)
ElementSetStyle(element, styleID)
Parameters and Return Values
[in] element (referenced PBElement): The element to modify.
[in] styleID (PBStyleID): The preset style identifier. This will determine the element's layout metrics and appearance.
Discussion
The element will be repainted later in the event loop and necessary relayouting will be requested.
Example (C/C++)
PBElementSetStyle((PBElement *) panel, PBStyleID_BORDER_OUTSIDE);
See Also
PBElementGetLayoutMetrics
Function: Get the layout metrics of an element, as determined by its style, scaled to appear in its window.
Syntax (C/C++)
PBLayoutMetrics PBElementGetLayoutMetrics(PBElementRef element);
Syntax (Python)
ElementGetLayoutMetrics(element) -> (layoutMetrics)
Parameters and Return Values
[in] element (referenced PBElement): The element.
[out] layoutMetrics (PBLayoutMetrics): Its style's layout metrics, with all dimensions given in pixels.
Discussion
You can change an element's layout metrics directly with PBElementSetCustomStyle. Changing its style with PBElementSetStyle will also cause the metrics to change.
The window's scale factor will be used to convert the dimensions in the metrics from dps to pixels automatically each time the scale factor changes.