1 \section{\class{wxSplitterWindow
}}\label{wxsplitterwindow
}
3 \overview{wxSplitterWindow overview
}{wxsplitterwindowoverview
}
5 This class manages up to two subwindows. The current view can be
6 split into two programmatically (perhaps from a menu command), and unsplit
7 either programmatically or via the wxSplitterWindow user interface.
9 Appropriate
3D shading for the Windows
95 user interface is an option.
11 \wxheading{Window styles
}
13 \begin{twocollist
}\itemsep=
0pt
14 \twocolitem{\windowstyle{wxSP
\_3D}}{Draws a
3D effect border and sash.
}
15 \twocolitem{\windowstyle{wxSP
\_BORDER}}{Draws a thin black border around the window, and a black sash.
}
16 \twocolitem{\windowstyle{wxSP
\_NOBORDER}}{No border, and a black sash.
}
19 See also
\helpref{window styles overview
}{windowstyles
}.
21 \wxheading{Derived from
}
23 \helpref{wxWindow
}{wxwindow
}\\
24 \helpref{wxEvtHandler
}{wxevthandler
}\\
25 \helpref{wxObject
}{wxobject
}
27 \wxheading{Include files
}
31 \latexignore{\rtfignore{\wxheading{Members
}}}
33 \membersection{wxSplitterWindow::wxSplitterWindow
}\label{wxsplitterwindowconstr
}
35 \func{}{wxSplitterWindow
}{\void}
39 \func{}{wxSplitterWindow
}{\param{wxWindow*
}{ parent
},
\param{wxWindowID
}{ id
},
\param{int
}{x
},
\rtfsp
40 \param{const wxPoint\&
}{point = wxDefaultPosition
},
\param{const wxSize\&
}{size = wxDefaultSize
},
\rtfsp
41 \param{long
}{style=wxSP
\_3D},
\param{const wxString\&
}{ name = "splitterWindow"
}}
43 Constructor for creating the window.
45 \wxheading{Parameters
}
47 \docparam{parent
}{The parent of the splitter window.
}
49 \docparam{id
}{The window identifier.
}
51 \docparam{pos
}{The window position.
}
53 \docparam{size
}{The window size.
}
55 \docparam{style
}{The window style. See
\helpref{wxSplitterWindow
}{wxsplitterwindow
}.
}
57 \docparam{name
}{The window name.
}
61 After using this constructor, you must create either one or two subwindows
62 with the splitter window as parent, and then call one of
\helpref{wxSplitterWindow::Initialize
}{wxsplitterwindowinitialize
},
\rtfsp
63 \helpref{wxSplitterWindow::SplitVertically
}{wxsplitterwindowsplitvertically
} and
\helpref{wxSplitterWindow::SplitHorizontally
}{wxsplitterwindowsplithorizontally
} in
64 order to set the pane(s).
66 You can create two windows, with one hidden when not being shown; or you can
67 create and delete the second pane on demand.
71 \helpref{wxSplitterWindow::Initialize
}{wxsplitterwindowinitialize
},
\helpref{wxSplitterWindow::SplitVertically
}{wxsplitterwindowsplitvertically
},
\rtfsp
72 \helpref{wxSplitterWindow::SplitHorizontally
}{wxsplitterwindowsplithorizontally
},
\rtfsp
73 \helpref{wxSplitterWindow::Create
}{wxsplitterwindowcreate
}
75 \membersection{wxSplitterWindow::
\destruct{wxSplitterWindow
}}
77 \func{}{\destruct{wxSplitterWindow
}}{\void}
79 Destroys the wxSplitterWindow and its children.
81 \membersection{wxSplitterWindow::Create
}\label{wxsplitterwindowcreate
}
83 \func{bool
}{Create
}{\param{wxWindow*
}{ parent
},
\param{wxWindowID
}{ id
},
\param{int
}{x
},
\rtfsp
84 \param{const wxPoint\&
}{point = wxDefaultPosition
},
\param{const wxSize\&
}{size = wxDefaultSize
},
\rtfsp
85 \param{long
}{style=wxSP
\_3D},
\param{const wxString\&
}{ name = "splitterWindow"
}}
87 Creation function, for two-step construction. See
\helpref{wxSplitterWindow::wxSplitterWindow
}{wxsplitterwindowconstr
} for
90 \membersection{wxSplitterWindow::GetMinimumPaneSize
}\label{wxsplitterwindowgetminimumpanesize
}
92 \constfunc{int
}{GetMinimumPaneSize
}{\void}
94 Returns the current minimum pane size (defaults to zero).
98 \helpref{wxSplitterWindow::SetMinimumPaneSize
}{wxsplitterwindowsetminimumpanesize
}
100 \membersection{wxSplitterWindow::GetSashPosition
}\label{wxsplitterwindowgetsashposition
}
102 \func{int
}{GetSashPosition
}{\void}
104 Returns the current sash position.
108 \helpref{wxSplitterWindow::SetSashPosition
}{wxsplitterwindowsetsashposition
}
110 \membersection{wxSplitterWindow::GetSplitMode
}\label{wxsplitterwindowgetsplitmode
}
112 \constfunc{int
}{GetSplitMode
}{\void}
118 \helpref{wxSplitterWindow::SetSplitMode
}{wxsplitterwindowsetsplitmode
},
\helpref{wxSplitterWindow::SplitVertically
}{wxsplitterwindowsplitvertically
},
\rtfsp
119 \helpref{wxSplitterWindow::SplitHorizontally
}{wxsplitterwindowsplithorizontally
}.
121 \membersection{wxSplitterWindow::GetWindow1
}\label{wxsplitterwindowgetwindow1
}
123 \constfunc{wxWindow*
}{GetWindow1
}{\void}
125 Returns the left/top or only pane.
127 \membersection{wxSplitterWindow::GetWindow2
}\label{wxsplitterwindowgetwindow2
}
129 \constfunc{wxWindow*
}{GetWindow2
}{\void}
131 Returns the right/bottom pane.
133 \membersection{wxSplitterWindow::Initialize
}\label{wxsplitterwindowinitialize
}
135 \func{void
}{Initialize
}{\param{wxWindow*
}{window
}}
137 Initializes the splitter window to have one pane.
139 \wxheading{Parameters
}
141 \docparam{window
}{The pane for the unsplit window.
}
145 This should be called if you wish to initially view only a single pane in the splitter window.
149 \helpref{wxSplitterWindow::SplitVertically
}{wxsplitterwindowsplitvertically
},
\rtfsp
150 \helpref{wxSplitterWindow::SplitHorizontally
}{wxsplitterwindowsplithorizontally
}
152 \membersection{wxSplitterWindow::IsSplit
}\label{wxsplitterwindowissplit
}
154 \constfunc{bool
}{IsSplit
}{\void}
156 Returns TRUE if the window is split, FALSE otherwise.
158 \membersection{wxSplitterWindow::OnDoubleClickSash
}\label{wxsplitterwindowondoubleclicksash
}
160 \func{virtual void
}{OnDoubleClickSash
}{\param{int
}{x
},
\param{int
}{y
}}
162 Application-overridable function called when the sash is double-clicked with
163 the left mouse button.
165 \wxheading{Parameters
}
167 \docparam{x
}{The x position of the mouse cursor.
}
169 \docparam{y
}{The y position of the mouse cursor.
}
173 The default implementation of this function calls
\helpref{Unsplit
}{wxsplitterwindowunsplit
} if
174 the minimum pane size is zero.
178 \helpref{wxSplitterWindow::Unsplit
}{wxsplitterwindowunsplit
}
180 \membersection{wxSplitterWindow::OnUnsplit
}\label{wxsplitterwindowonunsplit
}
182 \func{virtual void
}{OnUnsplit
}{\param{wxWindow*
}{removed
}}
184 Application-overridable function called when the window is unsplit, either
185 programmatically or using the wxSplitterWindow user interface.
187 \wxheading{Parameters
}
189 \docparam{removed
}{The window being removed.
}
193 The default implementation of this function simply hides
{\it removed
}. You
194 may wish to delete the window.
196 \membersection{wxSplitterWindow::OnSashPositionChange
}\label{wxsplitterwindowonsashpositionchange
}
198 \func{virtual bool
}{OnSashPositionChange
}{\param{int
}{newSashPosition
}}
200 Application-overridable function called when the sash position is changed by
201 user. It may return FALSE to prevent the change or TRUE to allow it.
203 \wxheading{Parameters
}
205 \docparam{newSashPosition
}{The new sash position (always positive or zero)
}
209 The default implementation of this function verifies that the sizes of both
210 panes of the splitter are greater than minimum pane size.
212 \membersection{wxSplitterWindow::ReplaceWindow
}\label{wxsplitterwindowreplacewindow
}
214 \func{bool
}{ReplaceWindow
}{\param{wxWindow *
}{winOld
},
\param{wxWindow *
}{winNew
}}
216 This function replaces one of the windows managed by the wxSplitterWindow with
217 another one. It is in general better to use it instead of calling Unsplit()
218 and then resplitting the window back because it will provoke much less flicker
219 (if any). It is valid to call this function whether the splitter has two
222 Both parameters should be non NULL and
{\it winOld
} must specify one of the
223 windows managed by the splitter. If the parameters are incorrect or the window
224 couldn't be replaced, FALSE is returned. Otherwise the function will return
225 TRUE, but please notice that it will not delete the replaced window and you
226 may wish to do it yourself.
230 \helpref{wxSplitterWindow::GetMinimumPaneSize
}{wxsplitterwindowgetminimumpanesize
}
234 \helpref{wxSplitterWindow::Unsplit
}{wxsplitterwindowunsplit
}\\
235 \helpref{wxSplitterWindow::SplitVertically
}{wxsplitterwindowsplitvertically
}\\
236 \helpref{wxSplitterWindow::SplitHorizontally
}{wxsplitterwindowsplithorizontally
}
238 \membersection{wxSplitterWindow::SetSashPosition
}\label{wxsplitterwindowsetsashposition
}
240 \func{void
}{SetSashPosition
}{\param{int
}{position
},
\param{const bool
}{ redraw = TRUE
}}
242 Sets the sash position.
244 \wxheading{Parameters
}
246 \docparam{position
}{The sash position in pixels.
}
248 \docparam{redraw
}{If TRUE, resizes the panes and redraws the sash and border.
}
252 Does not currently check for an out-of-range value.
256 \helpref{wxSplitterWindow::GetSashPosition
}{wxsplitterwindowgetsashposition
}
258 \membersection{wxSplitterWindow::SetMinimumPaneSize
}\label{wxsplitterwindowsetminimumpanesize
}
260 \func{void
}{SetMinimumPaneSize
}{\param{int
}{paneSize
}}
262 Sets the minimum pane size.
264 \wxheading{Parameters
}
266 \docparam{paneSize
}{Minimum pane size in pixels.
}
270 The default minimum pane size is zero, which means that either pane can be reduced to zero by dragging
271 the sash, thus removing one of the panes. To prevent this behaviour (and veto out-of-range sash dragging),
272 set a minimum size, for example
20 pixels.
276 \helpref{wxSplitterWindow::GetMinimumPaneSize
}{wxsplitterwindowgetminimumpanesize
}
278 \membersection{wxSplitterWindow::SetSplitMode
}\label{wxsplitterwindowsetsplitmode
}
280 \func{void
}{SetSplitMode
}{\param{int
}{mode
}}
284 \wxheading{Parameters
}
286 \docparam{mode
}{Can be wxSPLIT
\_VERTICAL or wxSPLIT
\_HORIZONTAL.
}
290 Only sets the internal variable; does not update the display.
294 \helpref{wxSplitterWindow::GetSplitMode
}{wxsplitterwindowgetsplitmode
},
\helpref{wxSplitterWindow::SplitVertically
}{wxsplitterwindowsplitvertically
},
\rtfsp
295 \helpref{wxSplitterWindow::SplitHorizontally
}{wxsplitterwindowsplithorizontally
}.
297 \membersection{wxSplitterWindow::SplitHorizontally
}\label{wxsplitterwindowsplithorizontally
}
299 \func{bool
}{SplitHorizontally
}{\param{wxWindow*
}{window1
},
\param{wxWindow*
}{window2
},
300 \param{int
}{ sashPosition =
0}}
302 Initializes the top and bottom panes of the splitter window.
304 \wxheading{Parameters
}
306 \docparam{window1
}{The top pane.
}
308 \docparam{window2
}{The bottom pane.
}
310 \docparam{sashPosition
}{The initial position of the sash. If this value is
311 positive, it specifies the size of the upper pane. If it's negative, it's
312 absolute value gives the size of the lower pane. Finally, specify
0 (default)
313 to choose the default position (half of the total window height).
}
315 \wxheading{Return value
}
317 TRUE if successful, FALSE otherwise (the window was already split).
321 This should be called if you wish to initially view two panes. It can also be
322 called at any subsequent time, but the application should check that the
323 window is not currently split using
\helpref{IsSplit
}{wxsplitterwindowissplit
}.
327 \helpref{wxSplitterWindow::SplitVertically
}{wxsplitterwindowsplitvertically
},
\helpref{wxSplitterWindow::IsSplit
}{wxsplitterwindowissplit
},
\rtfsp
328 \helpref{wxSplitterWindow::Unsplit
}{wxsplitterwindowunsplit
}
330 \membersection{wxSplitterWindow::SplitVertically
}\label{wxsplitterwindowsplitvertically
}
332 \func{bool
}{SplitVertically
}{\param{wxWindow*
}{window1
},
\param{wxWindow*
}{window2
},
333 \param{int
}{ sashPosition =
0}}
335 Initializes the left and right panes of the splitter window.
337 \wxheading{Parameters
}
339 \docparam{window1
}{The left pane.
}
341 \docparam{window2
}{The right pane.
}
343 \docparam{sashPosition
}{The initial position of the sash. If this value is
344 positive, it specifies the size of the left pane. If it's negative, it's
345 absolute value gives the size of the right pane. Finally, specify
0 (default)
346 to choose the default position (half of the total window width).
}
348 \wxheading{Return value
}
350 TRUE if successful, FALSE otherwise (the window was already split).
354 This should be called if you wish to initially view two panes. It can also be called at any subsequent time,
355 but the application should check that the window is not currently split using
\helpref{IsSplit
}{wxsplitterwindowissplit
}.
359 \helpref{wxSplitterWindow::SplitHorizontally
}{wxsplitterwindowsplithorizontally
},
\helpref{wxSplitterWindow::IsSplit
}{wxsplitterwindowissplit
},
\rtfsp
360 \helpref{wxSplitterWindow::Unsplit
}{wxsplitterwindowunsplit
}.
362 \membersection{wxSplitterWindow::Unsplit
}\label{wxsplitterwindowunsplit
}
364 \func{bool
}{Unsplit
}{\param{wxWindow*
}{toRemove = NULL
}}
368 \wxheading{Parameters
}
370 \docparam{toRemove
}{The pane to remove, or NULL to remove the right or bottom pane.
}
372 \wxheading{Return value
}
374 TRUE if successful, FALSE otherwise (the window was not split).
378 This call will not actually delete the pane being removed; it calls
\helpref{OnUnsplit
}{wxsplitterwindowonunsplit
}\rtfsp
379 which can be overridden for the desired behaviour. By default, the pane being removed is hidden.
383 \helpref{wxSplitterWindow::SplitHorizontally
}{wxsplitterwindowsplithorizontally
},
\helpref{wxSplitterWindow::SplitVertically
}{wxsplitterwindowsplitvertically
},
\rtfsp
384 \helpref{wxSplitterWindow::IsSplit
}{wxsplitterwindowissplit
},
\helpref{wxSplitterWindow::OnUnsplit
}{wxsplitterwindowonunsplit
}