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