CreateSplitter ( x,y,width,height,group[,style] )

Parameters

x,y - position of the splitter's top-left corner within the group's client area

width,height - size of the splitter

group - window or gadget group that owns the splitter

style (optional) - pane arrangement
1: left/right panes (default)
2: top/bottom panes

Description

Creates a splitter with two user-resizable panes and returns its handle.

A splitter divides its space into two panes with a draggable divider between them - the backbone of the classic editor layout with a 3D viewport on one side and an inspector on the other. Each pane is a gadget group: fetch its handle with SplitterPanel(splitter,0) and SplitterPanel(splitter,1), then create child gadgets inside and size them with ClientWidth and ClientHeight.

Dragging the divider posts gadget-action events ($401) with the divider position in EventData, and your event and render loop keeps running during the drag - a 3D canvas in one pane keeps animating while the user resizes it.
Use SetSplitterDragMode with mode 1 to show only a guide line during the drag and commit the pane sizes on release. In this mode a changed divider posts one gadget-action event on release.

Give the splitter a SetGadgetLayout so it follows window resizes; the panes and their contents follow along.
By default the first pane keeps its size and the second pane absorbs resizing. Use SetSplitterResizeMode to keep the second pane fixed instead, or preserve the proportions of both panes.

See it working in the world editor shell sample.


See also: SplitterPanel, SetSplitterLimits, CreatePanel, SetGadgetLayout, ClientWidth, CreateWindow.

Index