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