Contents Up Previous Next

wxSplitterWindow: wxCanvas

wxSplitterWindow overview

This class manages either one or 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.

Appropriate 3D shading for the Windows 95 user interface is an option.

wxSplitterWindow::wxSplitterWindow
wxSplitterWindow::~wxSplitterWindow
wxSplitterWindow::GetMinimumPaneSize
wxSplitterWindow::GetSashPosition
wxSplitterWindow::GetSplitMode
wxSplitterWindow::GetWindow1
wxSplitterWindow::GetWindow2
wxSplitterWindow::Initialize
wxSplitterWindow::IsSplit
wxSplitterWindow::OnDoubleClickSash
wxSplitterWindow::OnUnsplit
wxSplitterWindow::SetSashPosition
wxSplitterWindow::SetMinimumPaneSize
wxSplitterWindow::SetSplitMode
wxSplitterWindow::SplitHorizontally
wxSplitterWindow::SplitVertically
wxSplitterWindow::Unsplit


wxSplitterWindow::wxSplitterWindow

wxSplitterWindow(void)

Default constructor.

wxSplitterWindow(wxWindow *parent, int x, int y, int width, int height, long style=0, char *name)

Constructor for creating the window.

Parameters

parent

width

height

style

name

Remarks

After using this constructor, you must create either one or two subwindows with the splitter window as parent, and then call one of Initialize, SplitVertically and SplitHorizontally 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 also

Initialize, SplitVertically, SplitHorizontally


wxSplitterWindow::~wxSplitterWindow

~wxSplitterWindow(void)

Destroys the wxSplitterWindow and its children.


wxSplitterWindow::GetMinimumPaneSize

int GetMinimumPaneSize(void)

Returns the current minimum pane size (defaults to zero).

See also

SetMinimumPaneSize


wxSplitterWindow::GetSashPosition

int GetSashPosition(void)

Returns the current sash position.

See also

SetSashPosition


wxSplitterWindow::GetSplitMode

int GetSplitMode(void)

Gets the split mode.

See also

SetSplitMode, SplitVertically, SplitHorizontally.


wxSplitterWindow::GetWindow1

wxWindow* GetWindow1(void)

Returns the left/top or only pane.


wxSplitterWindow::GetWindow2

wxWindow* GetWindow2(void)

Returns the right/bottom pane.


wxSplitterWindow::Initialize

void Initialize(wxWindow* window)

Initializes the splitter window to have one pane.

Parameters

window

Remarks

This should be called if you wish to initially view only a single pane in the splitter window.

See also

SplitVertically, SplitHorizontally.


wxSplitterWindow::IsSplit

Bool IsSplit(void)

Returns TRUE if the window is split, FALSE otherwise.


wxSplitterWindow::OnDoubleClickSash

virtual void OnDoubleClickSash(int x, int y)

Application-overridable function called when the sash is double-clicked with the left mouse button.

Parameters

x

y

Remarks

The default implementation of this function calls Unsplit if the minimum pane size is zero.

See also

Unsplit


wxSplitterWindow::OnUnsplit

virtual void OnUnsplit(wxWindow* removed)

Application-overridable function called when the window is unsplit, either programmatically or using the wxSplitterWindow user interface.

Parameters

removed

Remarks

The default implementation of this function simply hides removed. You may wish to delete the window.

See also

Unsplit


wxSplitterWindow::SetSashPosition

void SetSashPosition(int position, Bool redraw = TRUE)

Sets the sash position.

Parameters

position

redraw

Remarks

Does not currently check for an out-of-range value.

See also

GetSashPosition


wxSplitterWindow::SetMinimumPaneSize

void SetMinimumPaneSize(int paneSize)

Sets the minimum pane size.

Parameters

paneSize

Remarks

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.

See also

GetMinimumPaneSize


wxSplitterWindow::SetSplitMode

void SetSplitMode(int mode)

Sets the split mode.

Parameters

mode

Remarks

Only sets the internal variable; does not update the display.

See also

GetSplitMode, SplitVertically, SplitHorizontally.


wxSplitterWindow::SplitHorizontally

Bool SplitHorizontally(wxWindow* window1, wxWindow* window2, int sashPosition = -1)

Initializes the top and bottom panes of the splitter window.

Parameters

window1

window2

sashPosition

Return value

TRUE if successful, FALSE otherwise (the window was already split).

Remarks

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.

See also

SplitVertically, IsSplit, Unsplit.


wxSplitterWindow::SplitVertically

Bool SplitVertically(wxWindow* window1, wxWindow* window2, int sashPosition = -1)

Initializes the left and right panes of the splitter window.

Parameters

window1

window2

sashPosition

Return value

TRUE if successful, FALSE otherwise (the window was already split).

Remarks

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.

See also

SplitHorizontally, IsSplit, Unsplit.


wxSplitterWindow::Unsplit

Bool Unsplit(wxWindow* toRemove = NULL)

Unsplits the window.

Parameters

toRemove

Return value

TRUE if successful, FALSE otherwise (the window was not split).

Remarks

This call will not actually delete the pane being removed; it calls OnUnsplit which can be overridden for the desired behaviour. By default, the pane being removed is hidden.

See also

SplitHorizontally, SplitVertically, IsSplit, OnUnsplit.