wxSplitterWindow

wxSplitterWindow

wxSplitterWindow
Functions for wxSplitterWindow class

This class manages up to two subwindows. The current view can be split into two programmatically (perhaps from a menu command), and unsplit either programmatically or via the wxSplitterWindow user interface.

Styles

This class supports the following styles:

See: wxSplitterEvent, Overview splitterwindow

This class is derived (and can use functions) from: wxWindow wxEvtHandler

wxWidgets docs: wxSplitterWindow

Types

Option =
    {id, integer()} |
    {pos, {X :: integer(), Y :: integer()}} |
    {size, {W :: integer(), H :: integer()}} |
    {style, integer()}

Constructor for creating the window.

Remark: After using this constructor, you must create either one or two subwindows with the splitter window as parent, and then call one of initialize/2, splitVertically/4 and splitHorizontally/4 in order to set the pane(s). You can create two windows, with one hidden when not being shown; or you can create and delete the second pane on demand.

See: initialize/2, splitVertically/4, splitHorizontally/4, create/3

Types

WinOld = WinNew = wxWindow:wxWindow()

This function replaces one of the windows managed by the wxSplitterWindow with another one.

It is in general better to use it instead of calling unsplit/2 and then resplitting the window back because it will provoke much less flicker (if any). It is valid to call this function whether the splitter has two windows or only one.

Both parameters should be non-NULL and winOld must specify one of the windows managed by the splitter. If the parameters are incorrect or the window couldn't be replaced, false is returned. Otherwise the function will return true, but please notice that it will not delete the replaced window and you may wish to do it yourself.

See: getMinimumPaneSize/1

Types

Gravity = number()

Sets the sash gravity.

Remark: Gravity is real factor which controls position of sash while resizing wxSplitterWindow. Gravity tells wxSplitterWindow how much will left/top window grow while resizing. Example values:

Notice that when sash gravity for a newly created splitter window, it is often necessary to explicitly set the splitter size using wxWindow:setSize/6 to ensure that is big enough for its initial sash position. Otherwise, i.e. if the window is created with the default tiny size and only resized to its correct size later, the initial sash position will be affected by the gravity and typically result in sash being at the rightmost position for the gravity of 1. See the example code creating wxSplitterWindow in the splitter sample for more details.

See: getSashGravity/1

Types

PaneSize = integer()

Sets the minimum pane size.

Remark: The default minimum pane size is zero, which means that either pane can be reduced to zero by dragging the sash, thus removing one of the panes. To prevent this behaviour (and veto out-of-range sash dragging), set a minimum size, for example 20 pixels. If the wxSP_PERMIT_UNSPLIT style is used when a splitter window is created, the window may be unsplit even if minimum size is non-zero.

See: getMinimumPaneSize/1

Types

Window1 = Window2 = wxWindow:wxWindow()
Option = {sashPosition, integer()}

Initializes the top and bottom panes of the splitter window.

The child windows are shown if they are currently hidden.

Return: true if successful, false otherwise (the window was already split).

Remark: This should be called if you wish to initially view two panes. It can also be called at any subsequent time, but the application should check that the window is not currently split using isSplit/1.

See: splitVertically/4, isSplit/1, unsplit/2

Types

Window1 = Window2 = wxWindow:wxWindow()
Option = {sashPosition, integer()}

Initializes the left and right panes of the splitter window.

The child windows are shown if they are currently hidden.

Return: true if successful, false otherwise (the window was already split).

Remark: This should be called if you wish to initially view two panes. It can also be called at any subsequent time, but the application should check that the window is not currently split using isSplit/1.

See: splitHorizontally/4, isSplit/1, unsplit/2

Types

Option = {toRemove, wxWindow:wxWindow()}

Unsplits the window.

Return: true if successful, false otherwise (the window was not split).

Remark: This call will not actually delete the pane being removed; it calls OnUnsplit() (not implemented in wx) which can be overridden for the desired behaviour. By default, the pane being removed is hidden.

See: splitHorizontally/4, splitVertically/4, isSplit/1, OnUnsplit() (not implemented in wx)

Types

Causes any pending sizing of the sash and child panes to take place immediately.

Such resizing normally takes place in idle time, in order to wait for layout to be completed. However, this can cause unacceptable flicker as the panes are resized after the window has been shown. To work around this, you can perform window layout (for example by sending a size event to the parent window), and then call this function, before showing the top-level window.