]> git.saurik.com Git - wxWidgets.git/blob - docs/latex/wx/tsplittr.tex
I've now added the documentation files.
[wxWidgets.git] / docs / latex / wx / tsplittr.tex
1 \section{wxSplitterWindow overview}\label{wxsplitterwindowoverview}
2
3 Classes: \helpref{wxSplitterWindow}{wxsplitterwindow}
4
5 The following screenshot shows the appearance of a splitter window with a vertical split.
6
7 $$\image{8cm;0cm}{splitter.eps}$$
8
9 The style wxSP\_3D has been used to show a 3D border and 3D sash.
10
11 \subsection{Example}
12
13 The following fragment shows how to create a splitter window, creating two
14 subwindows and hiding one of them.
15
16 {\small
17 \begin{verbatim}
18 splitter = new wxSplitterWindow(this, 0, 0, 400, 400, wxSP_3D);
19
20 leftCanvas = new MyCanvas(splitter);
21 leftCanvas->SetBackground(wxRED_BRUSH);
22 leftCanvas->SetScrollbars(20, 20, 50, 50, 4, 4);
23
24 rightCanvas = new MyCanvas(splitter);
25 rightCanvas->SetBackground(wxCYAN_BRUSH);
26 rightCanvas->SetScrollbars(20, 20, 50, 50, 4, 4);
27 rightCanvas->Show(FALSE);
28
29 splitter->Initialize(leftCanvas);
30
31 // Set this to prevent unsplitting
32 // splitter->SetMinimumPaneSize(20);
33 \end{verbatim}
34 }
35
36 The next fragment shows how the splitter window can be manipulated after creation.
37
38 {\small
39 \begin{verbatim}
40 void MyFrame::OnSplitVertical(wxCommandEvent& event)
41 {
42 if ( splitter->IsSplit() )
43 splitter->Unsplit();
44 leftCanvas->Show(TRUE);
45 rightCanvas->Show(TRUE);
46 splitter->SplitVertically( leftCanvas, rightCanvas );
47 }
48
49 void MyFrame::OnSplitHorizontal(wxCommandEvent& event)
50 {
51 if ( splitter->IsSplit() )
52 splitter->Unsplit();
53 leftCanvas->Show(TRUE);
54 rightCanvas->Show(TRUE);
55 splitter->SplitHorizontally( leftCanvas, rightCanvas );
56 }
57
58 void MyFrame::OnUnsplit(wxCommandEvent& event)
59 {
60 if ( splitter->IsSplit() )
61 splitter->Unsplit();
62 }
63 \end{verbatim}
64 }
65