1998-05-20 10:25:30 -04:00
\section { \class { wxSplitterWindow} } \label { wxsplitterwindow}
\overview { wxSplitterWindow overview} { wxsplitterwindowoverview}
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.
2001-12-06 12:01:00 -05:00
Appropriate 3D shading for the Windows 95 user interface is an option -
this is also recommended for GTK. Optionally, the sash can be made to
look more like the native control under MacOS X.
1998-05-20 10:25:30 -04:00
\wxheading { Window styles}
\begin { twocollist} \itemsep =0pt
\twocolitem { \windowstyle { wxSP\_ 3D} } { Draws a 3D effect border and sash.}
2000-07-15 15:51:35 -04:00
\twocolitem { \windowstyle { wxSP\_ 3DSASH} } { Draws a 3D effect sash.}
2003-07-22 18:12:32 -04:00
\twocolitem { \windowstyle { wxSP\_ 3DBORDER} } { Synonym for wxSP\_ BORDER.}
\twocolitem { \windowstyle { wxSP\_ BORDER} } { Draws a standard border.}
\twocolitem { \windowstyle { wxSP\_ NOBORDER} } { No border (default).}
1999-06-07 10:51:24 -04:00
\twocolitem { \windowstyle { wxSP\_ PERMIT\_ UNSPLIT} } { Always allow to
unsplit, even with the minimum pane size other than zero.}
\twocolitem { \windowstyle { wxSP\_ LIVE\_ UPDATE} } { Don't draw XOR line but resize the child windows immediately.}
1998-05-20 10:25:30 -04:00
\end { twocollist}
See also \helpref { window styles overview} { windowstyles} .
\wxheading { Derived from}
\helpref { wxWindow} { wxwindow} \\
\helpref { wxEvtHandler} { wxevthandler} \\
\helpref { wxObject} { wxobject}
1999-02-15 15:41:29 -05:00
\wxheading { Include files}
<wx/splitter.h>
1999-05-18 20:53:27 -04:00
\wxheading { Event handling}
To process input from a splitter control, use the following event handler
macros to direct input to member functions that take a
\helpref { wxSplitterEvent} { wxsplitterevent} argument.
1999-05-20 18:17:04 -04:00
\twocolwidtha { 10cm}
1999-05-18 20:53:27 -04:00
\begin { twocollist} \itemsep =0pt
1999-05-24 13:51:44 -04:00
\twocolitem { { \bf EVT\_ SPLITTER\_ SASH\_ POS\_ CHANGING(id, func)} } { The sash
position is in the process of being changed. May be used to modify the
position of the tracking bar to properly reflect the position that
would be set if the drag were to be completed at this point. Processes
a wxEVT\_ COMMAND\_ SPLITTER\_ SASH\_ POS\_ CHANGING event.}
1999-05-20 18:17:04 -04:00
\twocolitem { { \bf EVT\_ SPLITTER\_ SASH\_ POS\_ CHANGED(id, func)} } { The sash
1999-05-24 13:51:44 -04:00
position was changed. May be used to modify the sash position before
it is set, or to prevent the change from taking place.
Processes a wxEVT\_ COMMAND\_ SPLITTER\_ SASH\_ POS\_ CHANGED event.}
1999-05-20 18:17:04 -04:00
\twocolitem { { \bf EVT\_ SPLITTER\_ UNSPLIT(id, func)} } { The splitter has been just
1999-05-24 13:51:44 -04:00
unsplit. Processes a wxEVT\_ COMMAND\_ SPLITTER\_ UNSPLIT event.}
2002-07-03 11:01:26 -04:00
\twocolitem { { \bf EVT\_ SPLITTER\_ DCLICK(id, func)} } { The sash was double
1999-05-20 18:17:04 -04:00
clicked. The default behaviour is to unsplit the window when this happens
(unless the minimum pane size has been set to a value greater than zero).
1999-05-24 13:51:44 -04:00
Processes a wxEVT\_ COMMAND\_ SPLITTER\_ DOUBLECLICKED event.}
1999-05-18 20:53:27 -04:00
\end { twocollist} %
\wxheading { See also}
\helpref { wxSplitterEvent} { wxsplitterevent}
1998-05-20 10:25:30 -04:00
\latexignore { \rtfignore { \wxheading { Members} } }
\membersection { wxSplitterWindow::wxSplitterWindow} \label { wxsplitterwindowconstr}
\func { } { wxSplitterWindow} { \void }
Default constructor.
1999-05-24 13:51:44 -04:00
\func { } { wxSplitterWindow} { \param { wxWindow*} { parent} , \param { wxWindowID} { id} ,\rtfsp
1998-05-20 10:25:30 -04:00
\param { const wxPoint\& } { point = wxDefaultPosition} , \param { const wxSize\& } { size = wxDefaultSize} ,\rtfsp
1998-06-14 08:11:50 -04:00
\param { long } { style=wxSP\_ 3D} , \param { const wxString\& } { name = "splitterWindow"} }
1998-05-20 10:25:30 -04:00
Constructor for creating the window.
\wxheading { Parameters}
\docparam { parent} { The parent of the splitter window.}
\docparam { id} { The window identifier.}
\docparam { pos} { The window position.}
\docparam { size} { The window size.}
\docparam { style} { The window style. See \helpref { wxSplitterWindow} { wxsplitterwindow} .}
\docparam { name} { The window name.}
\wxheading { Remarks}
After using this constructor, you must create either one or two subwindows
with the splitter window as parent, and then call one of \helpref { wxSplitterWindow::Initialize} { wxsplitterwindowinitialize} ,\rtfsp
\helpref { wxSplitterWindow::SplitVertically} { wxsplitterwindowsplitvertically} and \helpref { wxSplitterWindow::SplitHorizontally} { wxsplitterwindowsplithorizontally} 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.
\wxheading { See also}
\helpref { wxSplitterWindow::Initialize} { wxsplitterwindowinitialize} , \helpref { wxSplitterWindow::SplitVertically} { wxsplitterwindowsplitvertically} ,\rtfsp
\helpref { wxSplitterWindow::SplitHorizontally} { wxsplitterwindowsplithorizontally} ,\rtfsp
\helpref { wxSplitterWindow::Create} { wxsplitterwindowcreate}
\membersection { wxSplitterWindow::\destruct { wxSplitterWindow} }
\func { } { \destruct { wxSplitterWindow} } { \void }
Destroys the wxSplitterWindow and its children.
\membersection { wxSplitterWindow::Create} \label { wxsplitterwindowcreate}
1998-06-14 08:11:50 -04:00
\func { bool} { Create} { \param { wxWindow*} { parent} , \param { wxWindowID} { id} , \param { int } { x} ,\rtfsp
1998-05-20 10:25:30 -04:00
\param { const wxPoint\& } { point = wxDefaultPosition} , \param { const wxSize\& } { size = wxDefaultSize} ,\rtfsp
1998-06-14 08:11:50 -04:00
\param { long } { style=wxSP\_ 3D} , \param { const wxString\& } { name = "splitterWindow"} }
1998-05-20 10:25:30 -04:00
Creation function, for two-step construction. See \helpref { wxSplitterWindow::wxSplitterWindow} { wxsplitterwindowconstr} for
details.
\membersection { wxSplitterWindow::GetMinimumPaneSize} \label { wxsplitterwindowgetminimumpanesize}
\constfunc { int} { GetMinimumPaneSize} { \void }
Returns the current minimum pane size (defaults to zero).
\wxheading { See also}
\helpref { wxSplitterWindow::SetMinimumPaneSize} { wxsplitterwindowsetminimumpanesize}
\membersection { wxSplitterWindow::GetSashPosition} \label { wxsplitterwindowgetsashposition}
\func { int} { GetSashPosition} { \void }
Returns the current sash position.
\wxheading { See also}
\helpref { wxSplitterWindow::SetSashPosition} { wxsplitterwindowsetsashposition}
\membersection { wxSplitterWindow::GetSplitMode} \label { wxsplitterwindowgetsplitmode}
\constfunc { int} { GetSplitMode} { \void }
Gets the split mode.
\wxheading { See also}
\helpref { wxSplitterWindow::SetSplitMode} { wxsplitterwindowsetsplitmode} , \helpref { wxSplitterWindow::SplitVertically} { wxsplitterwindowsplitvertically} ,\rtfsp
\helpref { wxSplitterWindow::SplitHorizontally} { wxsplitterwindowsplithorizontally} .
\membersection { wxSplitterWindow::GetWindow1} \label { wxsplitterwindowgetwindow1}
\constfunc { wxWindow*} { GetWindow1} { \void }
Returns the left/top or only pane.
\membersection { wxSplitterWindow::GetWindow2} \label { wxsplitterwindowgetwindow2}
\constfunc { wxWindow*} { GetWindow2} { \void }
Returns the right/bottom pane.
\membersection { wxSplitterWindow::Initialize} \label { wxsplitterwindowinitialize}
\func { void} { Initialize} { \param { wxWindow* } { window} }
Initializes the splitter window to have one pane.
\wxheading { Parameters}
\docparam { window} { The pane for the unsplit window.}
\wxheading { Remarks}
This should be called if you wish to initially view only a single pane in the splitter window.
\wxheading { See also}
\helpref { wxSplitterWindow::SplitVertically} { wxsplitterwindowsplitvertically} ,\rtfsp
1998-10-26 12:10:25 -05:00
\helpref { wxSplitterWindow::SplitHorizontally} { wxsplitterwindowsplithorizontally}
1998-05-20 10:25:30 -04:00
\membersection { wxSplitterWindow::IsSplit} \label { wxsplitterwindowissplit}
\constfunc { bool} { IsSplit} { \void }
2003-01-17 19:16:34 -05:00
Returns true if the window is split, false otherwise.
1998-05-20 10:25:30 -04:00
\membersection { wxSplitterWindow::OnDoubleClickSash} \label { wxsplitterwindowondoubleclicksash}
\func { virtual void} { OnDoubleClickSash} { \param { int } { x} , \param { int } { y} }
Application-overridable function called when the sash is double-clicked with
the left mouse button.
\wxheading { Parameters}
\docparam { x} { The x position of the mouse cursor.}
\docparam { y} { The y position of the mouse cursor.}
\wxheading { Remarks}
The default implementation of this function calls \helpref { Unsplit} { wxsplitterwindowunsplit} if
the minimum pane size is zero.
\wxheading { See also}
\helpref { wxSplitterWindow::Unsplit} { wxsplitterwindowunsplit}
\membersection { wxSplitterWindow::OnUnsplit} \label { wxsplitterwindowonunsplit}
\func { virtual void} { OnUnsplit} { \param { wxWindow* } { removed} }
Application-overridable function called when the window is unsplit, either
programmatically or using the wxSplitterWindow user interface.
\wxheading { Parameters}
\docparam { removed} { The window being removed.}
\wxheading { Remarks}
The default implementation of this function simply hides { \it removed} . You
may wish to delete the window.
1998-10-23 09:15:15 -04:00
\membersection { wxSplitterWindow::OnSashPositionChange} \label { wxsplitterwindowonsashpositionchange}
1998-10-26 12:10:25 -05:00
\func { virtual bool} { OnSashPositionChange} { \param { int } { newSashPosition} }
1998-10-23 09:15:15 -04:00
Application-overridable function called when the sash position is changed by
2003-01-17 19:16:34 -05:00
user. It may return false to prevent the change or true to allow it.
1998-10-23 09:15:15 -04:00
\wxheading { Parameters}
\docparam { newSashPosition} { The new sash position (always positive or zero)}
\wxheading { Remarks}
The default implementation of this function verifies that the sizes of both
panes of the splitter are greater than minimum pane size.
1999-02-10 08:38:12 -05:00
\membersection { wxSplitterWindow::ReplaceWindow} \label { wxsplitterwindowreplacewindow}
\func { bool} { ReplaceWindow} { \param { wxWindow * } { winOld} , \param { wxWindow * } { winNew} }
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()
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.
2000-07-15 15:51:35 -04:00
Both parameters should be non-NULL and { \it winOld} must specify one of the
1999-02-10 08:38:12 -05:00
windows managed by the splitter. If the parameters are incorrect or the window
2003-01-17 19:16:34 -05:00
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
1999-02-10 08:38:12 -05:00
may wish to do it yourself.
1998-05-20 10:25:30 -04:00
\wxheading { See also}
1998-10-23 09:15:15 -04:00
\helpref { wxSplitterWindow::GetMinimumPaneSize} { wxsplitterwindowgetminimumpanesize}
1998-05-20 10:25:30 -04:00
1999-02-10 08:38:12 -05:00
\wxheading { See also}
\helpref { wxSplitterWindow::Unsplit} { wxsplitterwindowunsplit} \\
\helpref { wxSplitterWindow::SplitVertically} { wxsplitterwindowsplitvertically} \\
\helpref { wxSplitterWindow::SplitHorizontally} { wxsplitterwindowsplithorizontally}
1998-05-20 10:25:30 -04:00
\membersection { wxSplitterWindow::SetSashPosition} \label { wxsplitterwindowsetsashposition}
2003-01-17 19:16:34 -05:00
\func { void} { SetSashPosition} { \param { int } { position} , \param { const bool} { redraw = true} }
1998-05-20 10:25:30 -04:00
Sets the sash position.
\wxheading { Parameters}
\docparam { position} { The sash position in pixels.}
2003-01-17 19:16:34 -05:00
\docparam { redraw} { If true, resizes the panes and redraws the sash and border.}
1998-05-20 10:25:30 -04:00
\wxheading { Remarks}
Does not currently check for an out-of-range value.
\wxheading { See also}
\helpref { wxSplitterWindow::GetSashPosition} { wxsplitterwindowgetsashposition}
\membersection { wxSplitterWindow::SetMinimumPaneSize} \label { wxsplitterwindowsetminimumpanesize}
1998-06-14 08:11:50 -04:00
\func { void} { SetMinimumPaneSize} { \param { int } { paneSize} }
1998-05-20 10:25:30 -04:00
Sets the minimum pane size.
\wxheading { Parameters}
\docparam { paneSize} { Minimum pane size in pixels.}
\wxheading { 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),
1999-05-24 13:51:44 -04:00
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.
1998-05-20 10:25:30 -04:00
\wxheading { See also}
\helpref { wxSplitterWindow::GetMinimumPaneSize} { wxsplitterwindowgetminimumpanesize}
\membersection { wxSplitterWindow::SetSplitMode} \label { wxsplitterwindowsetsplitmode}
1998-06-14 08:11:50 -04:00
\func { void} { SetSplitMode} { \param { int } { mode} }
1998-05-20 10:25:30 -04:00
Sets the split mode.
\wxheading { Parameters}
\docparam { mode} { Can be wxSPLIT\_ VERTICAL or wxSPLIT\_ HORIZONTAL.}
\wxheading { Remarks}
Only sets the internal variable; does not update the display.
\wxheading { See also}
\helpref { wxSplitterWindow::GetSplitMode} { wxsplitterwindowgetsplitmode} , \helpref { wxSplitterWindow::SplitVertically} { wxsplitterwindowsplitvertically} ,\rtfsp
\helpref { wxSplitterWindow::SplitHorizontally} { wxsplitterwindowsplithorizontally} .
\membersection { wxSplitterWindow::SplitHorizontally} \label { wxsplitterwindowsplithorizontally}
\func { bool} { SplitHorizontally} { \param { wxWindow* } { window1} , \param { wxWindow* } { window2} ,
1998-10-23 09:15:15 -04:00
\param { int} { sashPosition = 0} }
1998-05-20 10:25:30 -04:00
Initializes the top and bottom panes of the splitter window.
\wxheading { Parameters}
\docparam { window1} { The top pane.}
\docparam { window2} { The bottom pane.}
1998-10-23 09:15:15 -04:00
\docparam { sashPosition} { The initial position of the sash. If this value is
2000-07-15 15:51:35 -04:00
positive, it specifies the size of the upper pane. If it is negative, it is
1998-10-23 09:15:15 -04:00
absolute value gives the size of the lower pane. Finally, specify 0 (default)
to choose the default position (half of the total window height).}
1998-05-20 10:25:30 -04:00
\wxheading { Return value}
2003-01-17 19:16:34 -05:00
true if successful, false otherwise (the window was already split).
1998-05-20 10:25:30 -04:00
\wxheading { Remarks}
1998-10-23 09:15:15 -04:00
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 \helpref { IsSplit} { wxsplitterwindowissplit} .
1998-05-20 10:25:30 -04:00
\wxheading { See also}
\helpref { wxSplitterWindow::SplitVertically} { wxsplitterwindowsplitvertically} , \helpref { wxSplitterWindow::IsSplit} { wxsplitterwindowissplit} ,\rtfsp
1998-10-26 12:10:25 -05:00
\helpref { wxSplitterWindow::Unsplit} { wxsplitterwindowunsplit}
1998-05-20 10:25:30 -04:00
\membersection { wxSplitterWindow::SplitVertically} \label { wxsplitterwindowsplitvertically}
\func { bool} { SplitVertically} { \param { wxWindow* } { window1} , \param { wxWindow* } { window2} ,
1998-10-23 09:15:15 -04:00
\param { int} { sashPosition = 0} }
1998-05-20 10:25:30 -04:00
Initializes the left and right panes of the splitter window.
\wxheading { Parameters}
\docparam { window1} { The left pane.}
\docparam { window2} { The right pane.}
1998-10-23 09:15:15 -04:00
\docparam { sashPosition} { The initial position of the sash. If this value is
2000-07-15 15:51:35 -04:00
positive, it specifies the size of the left pane. If it is negative, it is
1998-10-23 09:15:15 -04:00
absolute value gives the size of the right pane. Finally, specify 0 (default)
to choose the default position (half of the total window width).}
1998-05-20 10:25:30 -04:00
\wxheading { Return value}
2003-01-17 19:16:34 -05:00
true if successful, false otherwise (the window was already split).
1998-05-20 10:25:30 -04:00
\wxheading { 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 \helpref { IsSplit} { wxsplitterwindowissplit} .
\wxheading { See also}
\helpref { wxSplitterWindow::SplitHorizontally} { wxsplitterwindowsplithorizontally} , \helpref { wxSplitterWindow::IsSplit} { wxsplitterwindowissplit} ,\rtfsp
\helpref { wxSplitterWindow::Unsplit} { wxsplitterwindowunsplit} .
\membersection { wxSplitterWindow::Unsplit} \label { wxsplitterwindowunsplit}
\func { bool} { Unsplit} { \param { wxWindow* } { toRemove = NULL} }
Unsplits the window.
\wxheading { Parameters}
\docparam { toRemove} { The pane to remove, or NULL to remove the right or bottom pane.}
\wxheading { Return value}
2003-01-17 19:16:34 -05:00
true if successful, false otherwise (the window was not split).
1998-05-20 10:25:30 -04:00
\wxheading { Remarks}
This call will not actually delete the pane being removed; it calls \helpref { OnUnsplit} { wxsplitterwindowonunsplit} \rtfsp
which can be overridden for the desired behaviour. By default, the pane being removed is hidden.
\wxheading { See also}
\helpref { wxSplitterWindow::SplitHorizontally} { wxsplitterwindowsplithorizontally} , \helpref { wxSplitterWindow::SplitVertically} { wxsplitterwindowsplitvertically} ,\rtfsp
\helpref { wxSplitterWindow::IsSplit} { wxsplitterwindowissplit} , \helpref { wxSplitterWindow::OnUnsplit} { wxsplitterwindowonunsplit}