A container that divides space among its children
PtWidget --> PtBasic --> PtContainer --> PtCompound --> PtDivider
For more information, see the diagram of the widget hierarchy.
<photon/PtDivider.h>
The PtDivider widget is a container that lays out its children like a one-row or one-column PtGroup widget, but allows the user to resize the children by dragging "handles" placed between the children.
Two PtDivider widgets: one contains a scroll area and two lists, the other contains some buttons.
The PtDivider class inherits resources from the PtGroup class. Access to these resources is controlled through PtDivider's exporting mechanism.
A blocking mechanism lets PtDivider block the inheritance of certain resources from its subordinate PtGroup widget. This prevents any actions that would negatively affect the look and behavior of a PtDivider widget. For more information, see the "Exported subordinate children" section.
Resource | C type | Pt type | Default |
---|---|---|---|
Pt_ARG_DIVIDER_FLAGS | unsigned short | Flag | Pt_DIVIDER_RESIZE_BOTH |
Pt_ARG_DIVIDER_OFFSET | short | Scalar | 0 |
Pt_ARG_DIVIDER_SIZES | PtDividerSizes_t, short | Array | NULL, 0 (read-only) |
Pt_CB_DIVIDER_DRAG | PtCallback_t * | Link | NULL |
C type | Pt type | Default |
---|---|---|
unsigned short | Flag | Pt_DIVIDER_RESIZE_BOTH |
Possible values:
C type | Pt type | Default |
---|---|---|
short | Scalar | 0 |
This number is added to positions of child widgets (relative to the position of the PtDivider widget) when the values for the Pt_ARG_DIVIDER_SIZES resource are calculated. By setting the Pt_ARG_DIVIDER_OFFSET resource you can make the Pt_ARG_DIVIDER_SIZES resource relative to any arbitrary point.
C type | Pt type | Default |
---|---|---|
PtDividerSizes_t, short | Array | NULL, 0 |
The array of positions and sizes of realized children of the divider. Each PtDividerSizes_t structure contains:
C type | Pt type | Default |
---|---|---|
PtCallback_t * | Link | NULL |
A list of callbacks that are invoked after each drag event received by the widget.
If the widget has the Pt_CALLBACKS_ACTIVE bit set in its Pt_ARG_FLAGS resource, these callbacks are also invoked when the size of a child is changed by a call to PtSetResources().
Each callback is passed a PtCallbackInfo_t structure that contains at least the following members:
These callbacks should return Pt_CONTINUE.
Unless the resources are already defined in PtDivider, the PtDivider class uses the resources of its exported subordinate child, PtGroup.
Where PtDivider and PtGroup both define resources having the same name, the resource defined in PtDivider takes precedence.
If PtDivider modifies an inherited resource, the "Default override" column indicates the new value. If PtDivider inherits a resource from PtGroup, the default value assigned by PtGroup is inherited too; the "Default override" column shows this default value.