Splitter
classin packageklyn.gui.windows
public class Splitter extends Container:
└ Splitter

Two-pane resizable container.

A splitter lays out a first and second widget separated by a draggable handle. The handle position is exposed as a percentage through ratio, while the internal drag precision remains finer to keep resizing smooth.

left = TreeView()
right = TabWidget()
splitter = Splitter(Splitter.HORIZONTAL, left, right)
splitter.ratio = 30
Fields
Modifier and Type Member Description
public static readonly HORIZONTAL
HORIZONTAL as String = "horizontal"
Horizontal splitter: panes are arranged left/right.
public static readonly VERTICAL
VERTICAL as String = "vertical"
Vertical splitter: panes are arranged top/bottom.
Attributes inherited from Widget: keyPressed, keyReleased, mouseMoved, mousePressed, mouseReleased, mouseWheel, paintRequested, resized
Properties
Modifier and Type Member Description
public property handleSize
handleSize as Int = 8
Draggable handle thickness in pixels.
public property minimumFirstPaneSize
minimumFirstPaneSize as Int = 220
Minimum size kept for the first pane while dragging.
public property minimumSecondPaneSize
minimumSecondPaneSize as Int = 520
Minimum size kept for the second pane while dragging.
public property orientation
orientation as String
Split orientation, horizontal or vertical.
public property ratio
ratio as Int:
Approximate first-pane percentage, clamped between 15 and 85.
Properties inherited from Container: autoRelayout, layout, padding, size
Properties inherited from Widget: accentColor, backgroundColor, borderColor, bottom, canFocus, cornerRadius, font, foregroundColor, hasFocus, height, isEnabled, isHovered, isManaged, isTabStop, isVisible, layoutParams, margin, maxHeight, maxWidth, minHeight, minWidth, parent, preferredHeight, preferredWidth, right, sizePolicy, styleClass, width, window, x, y
Constructors
Modifier and Type Member Description
public Splitter
Splitter(orientation as String = Splitter.HORIZONTAL, first as Widget = null, second as Widget = null):
Creates a splitter with optional initial panes.
Methods
Modifier and Type Member Description
public override applyLayout
applyLayout(recursive as Boolean = true) as Void:
No summary.
public beginDragAt
beginDragAt(x as Int, y as Int) as Boolean:
Starts dragging the splitter handle when the pointer is over it.
public dragTo
dragTo(x as Int, y as Int) as Boolean:
Moves the splitter handle during an active drag.
public endDrag
endDrag() as Void:
Ends the current splitter drag.
public override paint
paint(painter as Painter) as Void:
No summary.
public override setBounds
setBounds(x as Int, y as Int, width as Int, height as Int) as Void:
No summary.
public setFirst
setFirst(widget as Widget) as Void:
Replaces the first pane.
public setSecond
setSecond(widget as Widget) as Void:
Replaces the second pane.
Methods inherited from Container: add, applyLayout, attachWindow, children, clear, paintOverlay, remove, withLayout
Methods inherited from Widget: blur, containsPoint, emitKeyPressed, emitKeyReleased, emitMouseMoved, emitMousePressed, emitMouseReleased, emitMouseWheel, handleTabKey, notifyPaintRequested, paint, paintOverlay, repaint, requestFocus, resolvePreferredHeight, resolvePreferredWidth, resolvedFont, setBounds
Operators inherited from Container: operator[](index as Int) as Widget:, operator[](index as UInt) as Widget: