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 \latexignore{\rtfignore{\wxheading{Members
}}}
29 \membersection{wxSplitterWindow::wxSplitterWindow
}\label{wxsplitterwindowconstr
}
31 \func{}{wxSplitterWindow
}{\void}
35 \func{}{wxSplitterWindow
}{\param{wxWindow*
}{ parent
},
\param{const wxWindowID
}{ id
},
\param{int
}{x
},
\rtfsp
36 \param{const wxPoint\&
}{point = wxDefaultPosition
},
\param{const wxSize\&
}{size = wxDefaultSize
},
\rtfsp
37 \param{const long
}{style=wxSP
\_3D},
\param{const wxString\&
}{ name = "splitterWindow"
}}
39 Constructor for creating the window.
41 \wxheading{Parameters
}
43 \docparam{parent
}{The parent of the splitter window.
}
45 \docparam{id
}{The window identifier.
}
47 \docparam{pos
}{The window position.
}
49 \docparam{size
}{The window size.
}
51 \docparam{style
}{The window style. See
\helpref{wxSplitterWindow
}{wxsplitterwindow
}.
}
53 \docparam{name
}{The window name.
}
57 After using this constructor, you must create either one or two subwindows
58 with the splitter window as parent, and then call one of
\helpref{wxSplitterWindow::Initialize
}{wxsplitterwindowinitialize
},
\rtfsp
59 \helpref{wxSplitterWindow::SplitVertically
}{wxsplitterwindowsplitvertically
} and
\helpref{wxSplitterWindow::SplitHorizontally
}{wxsplitterwindowsplithorizontally
} in
60 order to set the pane(s).
62 You can create two windows, with one hidden when not being shown; or you can
63 create and delete the second pane on demand.
67 \helpref{wxSplitterWindow::Initialize
}{wxsplitterwindowinitialize
},
\helpref{wxSplitterWindow::SplitVertically
}{wxsplitterwindowsplitvertically
},
\rtfsp
68 \helpref{wxSplitterWindow::SplitHorizontally
}{wxsplitterwindowsplithorizontally
},
\rtfsp
69 \helpref{wxSplitterWindow::Create
}{wxsplitterwindowcreate
}
71 \membersection{wxSplitterWindow::
\destruct{wxSplitterWindow
}}
73 \func{}{\destruct{wxSplitterWindow
}}{\void}
75 Destroys the wxSplitterWindow and its children.
77 \membersection{wxSplitterWindow::Create
}\label{wxsplitterwindowcreate
}
79 \func{bool
}{Create
}{\param{wxWindow*
}{ parent
},
\param{const wxWindowID
}{ id
},
\param{int
}{x
},
\rtfsp
80 \param{const wxPoint\&
}{point = wxDefaultPosition
},
\param{const wxSize\&
}{size = wxDefaultSize
},
\rtfsp
81 \param{const long
}{style=wxSP
\_3D},
\param{const wxString\&
}{ name = "splitterWindow"
}}
83 Creation function, for two-step construction. See
\helpref{wxSplitterWindow::wxSplitterWindow
}{wxsplitterwindowconstr
} for
86 \membersection{wxSplitterWindow::GetMinimumPaneSize
}\label{wxsplitterwindowgetminimumpanesize
}
88 \constfunc{int
}{GetMinimumPaneSize
}{\void}
90 Returns the current minimum pane size (defaults to zero).
94 \helpref{wxSplitterWindow::SetMinimumPaneSize
}{wxsplitterwindowsetminimumpanesize
}
96 \membersection{wxSplitterWindow::GetSashPosition
}\label{wxsplitterwindowgetsashposition
}
98 \func{int
}{GetSashPosition
}{\void}
100 Returns the current sash position.
104 \helpref{wxSplitterWindow::SetSashPosition
}{wxsplitterwindowsetsashposition
}
106 \membersection{wxSplitterWindow::GetSplitMode
}\label{wxsplitterwindowgetsplitmode
}
108 \constfunc{int
}{GetSplitMode
}{\void}
114 \helpref{wxSplitterWindow::SetSplitMode
}{wxsplitterwindowsetsplitmode
},
\helpref{wxSplitterWindow::SplitVertically
}{wxsplitterwindowsplitvertically
},
\rtfsp
115 \helpref{wxSplitterWindow::SplitHorizontally
}{wxsplitterwindowsplithorizontally
}.
117 \membersection{wxSplitterWindow::GetWindow1
}\label{wxsplitterwindowgetwindow1
}
119 \constfunc{wxWindow*
}{GetWindow1
}{\void}
121 Returns the left/top or only pane.
123 \membersection{wxSplitterWindow::GetWindow2
}\label{wxsplitterwindowgetwindow2
}
125 \constfunc{wxWindow*
}{GetWindow2
}{\void}
127 Returns the right/bottom pane.
129 \membersection{wxSplitterWindow::Initialize
}\label{wxsplitterwindowinitialize
}
131 \func{void
}{Initialize
}{\param{wxWindow*
}{window
}}
133 Initializes the splitter window to have one pane.
135 \wxheading{Parameters
}
137 \docparam{window
}{The pane for the unsplit window.
}
141 This should be called if you wish to initially view only a single pane in the splitter window.
145 \helpref{wxSplitterWindow::SplitVertically
}{wxsplitterwindowsplitvertically
},
\rtfsp
146 \helpref{wxSplitterWindow::SplitHorizontally
}{wxsplitterwindowsplithorizontally
}.
148 \membersection{wxSplitterWindow::IsSplit
}\label{wxsplitterwindowissplit
}
150 \constfunc{bool
}{IsSplit
}{\void}
152 Returns TRUE if the window is split, FALSE otherwise.
154 \membersection{wxSplitterWindow::OnDoubleClickSash
}\label{wxsplitterwindowondoubleclicksash
}
156 \func{virtual void
}{OnDoubleClickSash
}{\param{int
}{x
},
\param{int
}{y
}}
158 Application-overridable function called when the sash is double-clicked with
159 the left mouse button.
161 \wxheading{Parameters
}
163 \docparam{x
}{The x position of the mouse cursor.
}
165 \docparam{y
}{The y position of the mouse cursor.
}
169 The default implementation of this function calls
\helpref{Unsplit
}{wxsplitterwindowunsplit
} if
170 the minimum pane size is zero.
174 \helpref{wxSplitterWindow::Unsplit
}{wxsplitterwindowunsplit
}
176 \membersection{wxSplitterWindow::OnUnsplit
}\label{wxsplitterwindowonunsplit
}
178 \func{virtual void
}{OnUnsplit
}{\param{wxWindow*
}{removed
}}
180 Application-overridable function called when the window is unsplit, either
181 programmatically or using the wxSplitterWindow user interface.
183 \wxheading{Parameters
}
185 \docparam{removed
}{The window being removed.
}
189 The default implementation of this function simply hides
{\it removed
}. You
190 may wish to delete the window.
194 \helpref{wxSplitterWindow::Unsplit
}{wxsplitterwindowunsplit
}
196 \membersection{wxSplitterWindow::SetSashPosition
}\label{wxsplitterwindowsetsashposition
}
198 \func{void
}{SetSashPosition
}{\param{const int
}{position
},
\param{const bool
}{ redraw = TRUE
}}
200 Sets the sash position.
202 \wxheading{Parameters
}
204 \docparam{position
}{The sash position in pixels.
}
206 \docparam{redraw
}{If TRUE, resizes the panes and redraws the sash and border.
}
210 Does not currently check for an out-of-range value.
214 \helpref{wxSplitterWindow::GetSashPosition
}{wxsplitterwindowgetsashposition
}
216 \membersection{wxSplitterWindow::SetMinimumPaneSize
}\label{wxsplitterwindowsetminimumpanesize
}
218 \func{void
}{SetMinimumPaneSize
}{\param{const int
}{paneSize
}}
220 Sets the minimum pane size.
222 \wxheading{Parameters
}
224 \docparam{paneSize
}{Minimum pane size in pixels.
}
228 The default minimum pane size is zero, which means that either pane can be reduced to zero by dragging
229 the sash, thus removing one of the panes. To prevent this behaviour (and veto out-of-range sash dragging),
230 set a minimum size, for example
20 pixels.
234 \helpref{wxSplitterWindow::GetMinimumPaneSize
}{wxsplitterwindowgetminimumpanesize
}
236 \membersection{wxSplitterWindow::SetSplitMode
}\label{wxsplitterwindowsetsplitmode
}
238 \func{void
}{SetSplitMode
}{\param{const int
}{mode
}}
242 \wxheading{Parameters
}
244 \docparam{mode
}{Can be wxSPLIT
\_VERTICAL or wxSPLIT
\_HORIZONTAL.
}
248 Only sets the internal variable; does not update the display.
252 \helpref{wxSplitterWindow::GetSplitMode
}{wxsplitterwindowgetsplitmode
},
\helpref{wxSplitterWindow::SplitVertically
}{wxsplitterwindowsplitvertically
},
\rtfsp
253 \helpref{wxSplitterWindow::SplitHorizontally
}{wxsplitterwindowsplithorizontally
}.
255 \membersection{wxSplitterWindow::SplitHorizontally
}\label{wxsplitterwindowsplithorizontally
}
257 \func{bool
}{SplitHorizontally
}{\param{wxWindow*
}{window1
},
\param{wxWindow*
}{window2
},
258 \param{const int
}{ sashPosition = -
1}}
260 Initializes the top and bottom panes of the splitter window.
262 \wxheading{Parameters
}
264 \docparam{window1
}{The top pane.
}
266 \docparam{window2
}{The bottom pane.
}
268 \docparam{sashPosition
}{The initial position of the sash. If the value is -
1, a default position
271 \wxheading{Return value
}
273 TRUE if successful, FALSE otherwise (the window was already split).
277 This should be called if you wish to initially view two panes. It can also be called at any subsequent time,
278 but the application should check that the window is not currently split using
\helpref{IsSplit
}{wxsplitterwindowissplit
}.
282 \helpref{wxSplitterWindow::SplitVertically
}{wxsplitterwindowsplitvertically
},
\helpref{wxSplitterWindow::IsSplit
}{wxsplitterwindowissplit
},
\rtfsp
283 \helpref{wxSplitterWindow::Unsplit
}{wxsplitterwindowunsplit
}.
285 \membersection{wxSplitterWindow::SplitVertically
}\label{wxsplitterwindowsplitvertically
}
287 \func{bool
}{SplitVertically
}{\param{wxWindow*
}{window1
},
\param{wxWindow*
}{window2
},
288 \param{const int
}{ sashPosition = -
1}}
290 Initializes the left and right panes of the splitter window.
292 \wxheading{Parameters
}
294 \docparam{window1
}{The left pane.
}
296 \docparam{window2
}{The right pane.
}
298 \docparam{sashPosition
}{The initial position of the sash. If the value is -
1, a default position
301 \wxheading{Return value
}
303 TRUE if successful, FALSE otherwise (the window was already split).
307 This should be called if you wish to initially view two panes. It can also be called at any subsequent time,
308 but the application should check that the window is not currently split using
\helpref{IsSplit
}{wxsplitterwindowissplit
}.
312 \helpref{wxSplitterWindow::SplitHorizontally
}{wxsplitterwindowsplithorizontally
},
\helpref{wxSplitterWindow::IsSplit
}{wxsplitterwindowissplit
},
\rtfsp
313 \helpref{wxSplitterWindow::Unsplit
}{wxsplitterwindowunsplit
}.
315 \membersection{wxSplitterWindow::Unsplit
}\label{wxsplitterwindowunsplit
}
317 \func{bool
}{Unsplit
}{\param{wxWindow*
}{toRemove = NULL
}}
321 \wxheading{Parameters
}
323 \docparam{toRemove
}{The pane to remove, or NULL to remove the right or bottom pane.
}
325 \wxheading{Return value
}
327 TRUE if successful, FALSE otherwise (the window was not split).
331 This call will not actually delete the pane being removed; it calls
\helpref{OnUnsplit
}{wxsplitterwindowonunsplit
}\rtfsp
332 which can be overridden for the desired behaviour. By default, the pane being removed is hidden.
336 \helpref{wxSplitterWindow::SplitHorizontally
}{wxsplitterwindowsplithorizontally
},
\helpref{wxSplitterWindow::SplitVertically
}{wxsplitterwindowsplitvertically
},
\rtfsp
337 \helpref{wxSplitterWindow::IsSplit
}{wxsplitterwindowissplit
},
\helpref{wxSplitterWindow::OnUnsplit
}{wxsplitterwindowonunsplit
}