wSplitter

wSplitter control is used to split a window into two resizable panel. The panels size and position can be changed by users or by setSize()/setPosition() programmatically.

A splitter can also attach to one or both panel so that the panel's margin become draggable. Of course it only works if the margin size near to the splitter is not zero.

Notice: To avoid flicker during resizing, add wDoubleBuffered or wClipChildren style depends on what controls you want to place into the panels. For most case, wDoubleBuffered is prefered, however, a few controls don't suppoort it. For example, report view mode of wListCtrl. Moreover, different version of Windows treats it differently. So please try and choose the best result by yourself.

Appearance:
Superclass:wControl
Styles:
StylesDescription
wSpVerticalSpecifies a vertical splitter.
wSpHorizontalSpecifies a horizontal splitter.
wSpNoBorderNo border (default).
wSpButtonDraws the splitter button style.
wSpBorderDraws a standard border.
wSp3dBorderDraws a 3D effect border around splitter.
Events:wCommandEvent
wCommandEventDescription
wEvent_SplitterThe position is dragging by user. This event can be vetoed.

Consts

wSpNoBorder = 0
wSpButton = 1152921504606846976
wSpBorder = wBorderSimple
wSp3dBorder = wBorderStatic

Procs

proc getPanel1(self: wSplitter): wPanel {...}{.validate, property, inline, raises: [],
                                      tags: [].}
Returns the left/top panel.
proc getPanel2(self: wSplitter): wPanel {...}{.validate, property, inline, raises: [],
                                      tags: [].}
Returns the right/bottom panel.
proc setMinPanelSize1(self: wSplitter; min = 0) {...}{.validate, property, inline, raises: [],
    tags: [].}
Sets the minimum size of left/top panel.
proc setMinPanelSize2(self: wSplitter; min = 0) {...}{.validate, property, inline, raises: [],
    tags: [].}
Sets the minimum size of right/bottom panel.
proc setMinPanelSize(self: wSplitter; min = 0) {...}{.validate, property, inline, raises: [],
    tags: [].}
Sets the minimum size of both panels.
proc setInvisible(self: wSplitter) {...}{.validate, property, inline, raises: [], tags: [].}
Sets the splitter should be invisible. The same as setSize(0, 0).
proc setPanel1(self: wSplitter; panel: wPanel): wPanel {...}{.validate, property,
    discardable, raises: [], tags: [].}
This function replaces the left/top panel with another one. New panel's parent must the same as splitter's parent. Otherwise, the function failure. Returns the old panel or nil.
proc setPanel2(self: wSplitter; panel: wPanel): wPanel {...}{.validate, property,
    discardable, raises: [], tags: [].}
This function replaces the right/bottom panel with another one. New panel's parent must the same as splitter's parent. Otherwise, the function failure. Returns the old panel or nil.
proc swap(self: wSplitter) {...}{.validate, raises: [], tags: [].}
Swaps two panel.
proc attachPanel1(self: wSplitter; attach = true) {...}{.validate, inline, raises: [], tags: [].}
Attach the splitter to left/top panel so that users can drag the margin of the panel to resize it.
proc attachPanel2(self: wSplitter; attach = true) {...}{.validate, inline, raises: [], tags: [].}
Attach the splitter to right/bottom panel so that users can drag the margin of the panel to resize it.
proc attachPanel(self: wSplitter; attach = true) {...}{.validate, inline, raises: [], tags: [].}
Attach splitter to both panels.
proc setSplitMode(self: wSplitter; mode: int) {...}{.validate, property, raises: [], tags: [].}
Sets the split mode. Mode can be wSpHorizontal or wSpVertical.
proc final(self: wSplitter) {...}{.raises: [], tags: [].}
Default finalizer for wSplitter.
proc init(self: wSplitter; parent: wWindow; id = wDefaultID; pos = wDefaultPoint;
         size = wDefaultSize; style: wStyle = wSpVertical; className = "wSplitter") {...}{.
    validate, raises: [], tags: [].}
Initializer.
proc Splitter(parent: wWindow; id = wDefaultID; pos = wDefaultPoint; size = wDefaultSize;
             style: wStyle = wSpVertical; className = "wSplitter"): wSplitter {...}{.inline,
    discardable, raises: [], tags: [].}
Constructor. For vertical splitter, settings of y-axis are ignored, vice versa.