> home > Custom Layer Boundary API

panel_split

September 8th 2024
Introduce a split at a given panel

Signature

C++
b32
panel_split(Application_Links* app,
            Panel_ID panel_id,
            Dimension split_dim);

Parameters

app

the standard custom layer context pointer

panel_id

the id of the panel to split

split_dim

the dimension along which the split is placed - x splits split the horizontal axis with a vertical divider - y splits split the vertical axis with a horizontal divider

Return

non-zero on success, when the panel exists and splitting it is possible, zero otherwise

Details

New splits are created as 50/50 proportional splits.
The only limit on splits is the number of views, which is 16. When a leaf panel is split, the view it was associated with is placed in the 'min' child of the split and a panel with a new view is placed in the 'max' child of the split. When an internal panel is split, it's 'min' child adopts the old children and split settings of the panel and the 'max' child gets a panel with a new view.
In either case, a successful split puts a new leaf panel in the 'max' child, puts the old contents of the panel into the 'min' child. The id of the panel that was split becomes the id of the parent of the split. View panel associations are modified by a split.