1 \section{wxSplitterWindow overview
}\label{wxsplitterwindowoverview
}
3 Classes:
\helpref{wxSplitterWindow
}{wxsplitterwindow
}
5 The following screenshot shows the appearance of a splitter window with a vertical split.
7 $$
\image{8cm;
0cm
}{splitter.eps
}$$
9 The style wxSP
\_3D has been used to show a
3D border and
3D sash.
13 The following fragment shows how to create a splitter window, creating two
14 subwindows and hiding one of them.
18 splitter = new wxSplitterWindow(this,
0,
0,
400,
400, wxSP_3D);
20 leftCanvas = new MyCanvas(splitter);
21 leftCanvas->SetBackground(wxRED_BRUSH);
22 leftCanvas->SetScrollbars(
20,
20,
50,
50,
4,
4);
24 rightCanvas = new MyCanvas(splitter);
25 rightCanvas->SetBackground(wxCYAN_BRUSH);
26 rightCanvas->SetScrollbars(
20,
20,
50,
50,
4,
4);
27 rightCanvas->Show(FALSE);
29 splitter->Initialize(leftCanvas);
31 // Set this to prevent unsplitting
32 // splitter->SetMinimumPaneSize(
20);
36 The next fragment shows how the splitter window can be manipulated after creation.
40 void MyFrame::OnSplitVertical(wxCommandEvent& event)
42 if ( splitter->IsSplit() )
44 leftCanvas->Show(TRUE);
45 rightCanvas->Show(TRUE);
46 splitter->SplitVertically( leftCanvas, rightCanvas );
49 void MyFrame::OnSplitHorizontal(wxCommandEvent& event)
51 if ( splitter->IsSplit() )
53 leftCanvas->Show(TRUE);
54 rightCanvas->Show(TRUE);
55 splitter->SplitHorizontally( leftCanvas, rightCanvas );
58 void MyFrame::OnUnsplit(wxCommandEvent& event)
60 if ( splitter->IsSplit() )