]>
Commit | Line | Data |
---|---|---|
15b6757b | 1 | ///////////////////////////////////////////////////////////////////////////// |
23114fe1 | 2 | // Name: splitterwindow.h |
15b6757b FM |
3 | // Purpose: topic overview |
4 | // Author: wxWidgets team | |
5 | // RCS-ID: $Id$ | |
526954c5 | 6 | // Licence: wxWindows licence |
15b6757b FM |
7 | ///////////////////////////////////////////////////////////////////////////// |
8 | ||
880efa2a | 9 | /** |
36c9828f | 10 | |
23114fe1 | 11 | @page overview_splitterwindow wxSplitterWindow Overview |
36c9828f | 12 | |
831e1028 | 13 | @tableofcontents |
36c9828f | 14 | |
831e1028 | 15 | @see wxSplitterWindow |
30738aae | 16 | |
30738aae FM |
17 | |
18 | ||
19 | @section overview_splitterwindow_appearance Appearance | |
20 | ||
23114fe1 BP |
21 | The following screenshot shows the appearance of a splitter window with a |
22 | horizontal split. | |
36c9828f | 23 | |
23114fe1 | 24 | The style wxSP_3D has been used to show a 3D border and 3D sash. |
36c9828f | 25 | |
de2b67e6 | 26 | @image html overview_splitter_3d.png |
36c9828f | 27 | |
36c9828f | 28 | |
23114fe1 | 29 | @section overview_splitterwindow_example Example |
36c9828f | 30 | |
23114fe1 BP |
31 | The following fragment shows how to create a splitter window, creating two |
32 | subwindows and hiding one of them. | |
36c9828f | 33 | |
23114fe1 BP |
34 | @code |
35 | splitter = new wxSplitterWindow(this, -1, wxPoint(0, 0), | |
36 | wxSize(400, 400), wxSP_3D); | |
36c9828f | 37 | |
23114fe1 BP |
38 | leftWindow = new MyWindow(splitter); |
39 | leftWindow->SetScrollbars(20, 20, 50, 50); | |
36c9828f | 40 | |
23114fe1 BP |
41 | rightWindow = new MyWindow(splitter); |
42 | rightWindow->SetScrollbars(20, 20, 50, 50); | |
43 | rightWindow->Show(false); | |
36c9828f | 44 | |
23114fe1 | 45 | splitter->Initialize(leftWindow); |
36c9828f | 46 | |
23114fe1 BP |
47 | // Set this to prevent unsplitting |
48 | // splitter->SetMinimumPaneSize(20); | |
49 | @endcode | |
36c9828f | 50 | |
23114fe1 BP |
51 | The next fragment shows how the splitter window can be manipulated after |
52 | creation. | |
36c9828f | 53 | |
23114fe1 BP |
54 | @code |
55 | void MyFrame::OnSplitVertical(wxCommandEvent& event) | |
56 | { | |
57 | if ( splitter->IsSplit() ) | |
58 | splitter->Unsplit(); | |
59 | leftWindow->Show(true); | |
60 | rightWindow->Show(true); | |
61 | splitter->SplitVertically( leftWindow, rightWindow ); | |
62 | } | |
36c9828f | 63 | |
23114fe1 BP |
64 | void MyFrame::OnSplitHorizontal(wxCommandEvent& event) |
65 | { | |
66 | if ( splitter->IsSplit() ) | |
67 | splitter->Unsplit(); | |
68 | leftWindow->Show(true); | |
69 | rightWindow->Show(true); | |
70 | splitter->SplitHorizontally( leftWindow, rightWindow ); | |
71 | } | |
36c9828f | 72 | |
23114fe1 BP |
73 | void MyFrame::OnUnsplit(wxCommandEvent& event) |
74 | { | |
75 | if ( splitter->IsSplit() ) | |
76 | splitter->Unsplit(); | |
77 | } | |
78 | @endcode | |
36c9828f | 79 | |
23114fe1 | 80 | */ |