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'i64
wSpBorder = 0x00800000
wSp3dBorder = 562949953421312'i64

Procs

proc isVertical(self: wSplitter): bool {...}{.inline, raises: [], tags: [].}
Returns true if the splitter is vertical and false otherwise.
proc getPanel1(self: wSplitter): wPanel {...}{.inline, raises: [], tags: [].}
Returns the left/top panel.
proc getPanel2(self: wSplitter): wPanel {...}{.inline, raises: [], tags: [].}
Returns the right/bottom panel.
proc setMinPanelSize1(self: wSplitter; min = 0) {...}{.inline, raises: [Exception],
    tags: [RootEffect].}
Sets the minimum size of left/top panel.
proc setMinPanelSize2(self: wSplitter; min = 0) {...}{.inline, raises: [Exception],
    tags: [RootEffect].}
Sets the minimum size of right/bottom panel.
proc setMinPanelSize(self: wSplitter; min = 0) {...}{.inline, raises: [Exception],
    tags: [RootEffect].}
Sets the minimum size of both panels.
proc setInvisible(self: wSplitter) {...}{.inline, raises: [Exception], tags: [RootEffect].}
Sets the splitter should be invisible. The same as setSize(0, 0).
proc setPanel1(self: wSplitter; panel: wPanel): wPanel {...}{.discardable,
    raises: [Exception, wCursorError], tags: [RootEffect].}
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 {...}{.discardable,
    raises: [Exception, wCursorError], tags: [RootEffect].}
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) {...}{.raises: [Exception, wCursorError], tags: [RootEffect].}
Swaps two panel.
proc attachPanel1(self: wSplitter; attach = true) {...}{.inline,
    raises: [Exception, wCursorError], tags: [RootEffect].}
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) {...}{.inline,
    raises: [Exception, wCursorError], tags: [RootEffect].}
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) {...}{.inline,
    raises: [Exception, wCursorError], tags: [RootEffect].}
Attach splitter to both panels.
proc setSplitMode(self: wSplitter; mode: int) {...}{.
    raises: [Exception, wNilAccess, wCursorError], tags: [RootEffect].}
Sets the split mode. Mode can be wSpHorizontal or wSpVertical.
proc init(self: wSplitter; parent: wWindow; id = wDefaultID; pos = wDefaultPoint;
         size = wDefaultSize; style: wStyle = wSpVertical; className = "wSplitter") {...}{.raises: [
    wNilAccess, wWindowError, wCursorError, wBrushError, Exception, IndexDefect,
    wFontError, wPenError], tags: [RootEffect].}
Initializes a splitter. For vertical splitter, settings of y-axis are ignored, vice versa.
proc Splitter(parent: wWindow; id = wDefaultID; pos = wDefaultPoint; size = wDefaultSize;
             style: wStyle = wSpVertical; className = "wSplitter"): wSplitter {...}{.inline,
    discardable, raises: [wNilAccess, wWindowError, wCursorError, wBrushError,
                        Exception, IndexDefect, wFontError, wPenError],
    tags: [RootEffect].}
Constructor.

Methods

method release(self: wSplitter) {...}{.raises: [], tags: [RootEffect].}
Release all the resources during destroying. Used internally.