]>
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 | |
23114fe1 | 13 | Classes: wxSplitterWindow |
36c9828f | 14 | |
30738aae FM |
15 | @li @ref overview_splitterwindow_appearance |
16 | @li @ref overview_splitterwindow_example | |
17 | ||
18 | <hr> | |
19 | ||
20 | ||
21 | @section overview_splitterwindow_appearance Appearance | |
22 | ||
23114fe1 BP |
23 | The following screenshot shows the appearance of a splitter window with a |
24 | horizontal split. | |
36c9828f | 25 | |
23114fe1 | 26 | The style wxSP_3D has been used to show a 3D border and 3D sash. |
36c9828f | 27 | |
de2b67e6 | 28 | @image html overview_splitter_3d.png |
36c9828f | 29 | |
36c9828f | 30 | |
23114fe1 | 31 | @section overview_splitterwindow_example Example |
36c9828f | 32 | |
23114fe1 BP |
33 | The following fragment shows how to create a splitter window, creating two |
34 | subwindows and hiding one of them. | |
36c9828f | 35 | |
23114fe1 BP |
36 | @code |
37 | splitter = new wxSplitterWindow(this, -1, wxPoint(0, 0), | |
38 | wxSize(400, 400), wxSP_3D); | |
36c9828f | 39 | |
23114fe1 BP |
40 | leftWindow = new MyWindow(splitter); |
41 | leftWindow->SetScrollbars(20, 20, 50, 50); | |
36c9828f | 42 | |
23114fe1 BP |
43 | rightWindow = new MyWindow(splitter); |
44 | rightWindow->SetScrollbars(20, 20, 50, 50); | |
45 | rightWindow->Show(false); | |
36c9828f | 46 | |
23114fe1 | 47 | splitter->Initialize(leftWindow); |
36c9828f | 48 | |
23114fe1 BP |
49 | // Set this to prevent unsplitting |
50 | // splitter->SetMinimumPaneSize(20); | |
51 | @endcode | |
36c9828f | 52 | |
23114fe1 BP |
53 | The next fragment shows how the splitter window can be manipulated after |
54 | creation. | |
36c9828f | 55 | |
23114fe1 BP |
56 | @code |
57 | void MyFrame::OnSplitVertical(wxCommandEvent& event) | |
58 | { | |
59 | if ( splitter->IsSplit() ) | |
60 | splitter->Unsplit(); | |
61 | leftWindow->Show(true); | |
62 | rightWindow->Show(true); | |
63 | splitter->SplitVertically( leftWindow, rightWindow ); | |
64 | } | |
36c9828f | 65 | |
23114fe1 BP |
66 | void MyFrame::OnSplitHorizontal(wxCommandEvent& event) |
67 | { | |
68 | if ( splitter->IsSplit() ) | |
69 | splitter->Unsplit(); | |
70 | leftWindow->Show(true); | |
71 | rightWindow->Show(true); | |
72 | splitter->SplitHorizontally( leftWindow, rightWindow ); | |
73 | } | |
36c9828f | 74 | |
23114fe1 BP |
75 | void MyFrame::OnUnsplit(wxCommandEvent& event) |
76 | { | |
77 | if ( splitter->IsSplit() ) | |
78 | splitter->Unsplit(); | |
79 | } | |
80 | @endcode | |
36c9828f | 81 | |
23114fe1 | 82 | */ |
36c9828f | 83 |