Two resizable panes with a draggable divider: side by side (vertical = false) or stacked (vertical = true). Add each pane's content to first / second (origin at the pane's top-left); the panes are clipped to their region, so overflow is hidden and only in-region content takes the pointer. Dragging the divider moves the split, honouring minFirst / minSecond.

position is the first pane's size along the split axis, in UI pixels; onResized reports the two pane sizes after a drag. Non-interactive except for the divider — pane content keeps its own interactivity.

Constructor

new(vertical:Bool, width:Float, height:Float, ?position:Float)

Parameters:

vertical

true for stacked panes, false for side-by-side

width

layout width

height

layout height

position

optional initial first-pane size (defaults to half)

Variables

@:value(6)dividerThickness:Float = 6

Base (unscaled) divider thickness.

finalfirst:Sprite

Add the first (left/top) pane's content here.

@:value(48)minFirst:Float = 48

Smallest the first pane may become.

@:value(48)minSecond:Float = 48

Smallest the second pane may become.

@:value(0)position:Float = 0

The first pane's size along the split axis, in UI pixels (clamped to the min sizes).

finalsecond:Sprite

Add the second (right/bottom) pane's content here.

vertical:Bool

true stacks the panes (top/bottom, horizontal divider); false places them side by side.

@:value(null)onResized:(first:Float, second:Float) ‑> Void = null

Fired after a divider drag, with the first and second pane sizes.

Methods

Inherited Variables

Defined by UIComponent

@:value(true)enabled:Bool = true

Disabled widgets ignore the pointer and typically render dimmed.

@:value(0)read onlyh:Float = 0

Layout height in UI units.

@:value(MouseCursor.BUTTON)hoverCursor:MouseCursor = MouseCursor.BUTTON

Native cursor while hovering (interactive widgets; null keeps the arrow).

@:value(false)read onlyhovered:Bool = false

true while the cursor is over this widget.

@:value(false)longPressable:Bool = false

Opts a subclass that overrides onRightPress (without setting onRightClick) into long-press-as-right-click on touch. Widgets with onRightClick set are included automatically.

@:value(null)onClick:() ‑> Void = null

Fired on a completed click (press + release on this widget). Requires an interactive widget.

@:value(null)onHover:() ‑> Void = null

Fired when the cursor first enters this widget (hover-driven descriptions/previews). Interactive widgets only.

@:value(null)onRightClick:() ‑> Void = null

Fired on a right mouse press over this widget (context menus). Only interactive widgets receive pointer events, so this never fires on passive widgets like UILabel/UIPanel — attach it to a UIButton (or another interactive widget) instead. On touch, a long-press fires the same path (see UIRoot.longPressMs).

@:value(false)read onlypressed:Bool = false

true while a press that started here is held.

@:value(null)tooltip:String = null

Optional tooltip text (already-localized or a fixed string).

@:value(null)tooltipShortcut:String = null

Optional right-aligned shortcut hint rendered in the tooltip.

@:value(0)read onlyw:Float = 0

Layout width in UI units (independent of DisplayObject's content-derived width).

Inherited Methods

Defined by UIComponent

dispose():Void

Tears the widget down: listeners, pointer references, children, parent link.

invalidate():Void

Schedules a repaint for the next frame (cheap; deduplicated).

resize(width:Float, height:Float):Void

Sets the layout size and repaints when it changed.

Parameters:

width

the new layout width in UI units

height

the new layout height in UI units