]> git.saurik.com Git - wxWidgets.git/blob - interface/mdi.h
Compilation fixes for mingw-w64.
[wxWidgets.git] / interface / mdi.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: mdi.h
3 // Purpose: interface of wxMDIClientWindow
4 // Author: wxWidgets team
5 // RCS-ID: $Id$
6 // Licence: wxWindows license
7 /////////////////////////////////////////////////////////////////////////////
8
9 /**
10 @class wxMDIClientWindow
11 @wxheader{mdi.h}
12
13 An MDI client window is a child of wxMDIParentFrame, and manages zero or
14 more wxMDIChildFrame objects.
15
16 @library{wxcore}
17 @category{FIXME}
18
19 @see wxMDIChildFrame, wxMDIParentFrame, wxFrame
20 */
21 class wxMDIClientWindow : public wxWindow
22 {
23 public:
24 //@{
25 /**
26 Constructor, creating the window.
27
28 @param parent
29 The window parent.
30 @param style
31 The window style. Currently unused.
32
33 @remarks The second style of constructor is called within
34 wxMDIParentFrame::OnCreateClient.
35
36 @see wxMDIParentFrame::wxMDIParentFrame, wxMDIParentFrame::OnCreateClient
37 */
38 wxMDIClientWindow();
39 wxMDIClientWindow(wxMDIParentFrame* parent, long style = 0);
40 //@}
41
42 /**
43 Destructor.
44 */
45 ~wxMDIClientWindow();
46
47 /**
48 Used in two-step frame construction. See wxMDIClientWindow()
49 for further details.
50 */
51 bool CreateClient(wxMDIParentFrame* parent, long style = 0);
52 };
53
54
55
56 /**
57 @class wxMDIParentFrame
58 @wxheader{mdi.h}
59
60 An MDI (Multiple Document Interface) parent frame is a window which can contain
61 MDI child frames in its own 'desktop'. It is a convenient way to avoid window
62 clutter,
63 and is used in many popular Windows applications, such as Microsoft Word(TM).
64
65 @beginStyleTable
66 @style{wxCAPTION}
67 Puts a caption on the frame.
68 @style{wxDEFAULT_FRAME_STYLE}
69 Defined as wxMINIMIZE_BOX | wxMAXIMIZE_BOX | wxTHICK_FRAME |
70 wxSYSTEM_MENU | wxCAPTION.
71 @style{wxHSCROLL}
72 Displays a horizontal scrollbar in the client window, allowing the
73 user to view child frames that are off the current view.
74 @style{wxICONIZE}
75 Display the frame iconized (minimized) (Windows only).
76 @style{wxMAXIMIZE}
77 Displays the frame maximized (Windows only).
78 @style{wxMAXIMIZE_BOX}
79 Displays a maximize box on the frame (Windows and Motif only).
80 @style{wxMINIMIZE}
81 Identical to wxICONIZE.
82 @style{wxMINIMIZE_BOX}
83 Displays a minimize box on the frame (Windows and Motif only).
84 @style{wxRESIZE_BORDER}
85 Displays a resizeable border around the window (Motif only; for
86 Windows, it is implicit in wxTHICK_FRAME).
87 @style{wxSTAY_ON_TOP}
88 Stay on top of other windows (Windows only).
89 @style{wxSYSTEM_MENU}
90 Displays a system menu (Windows and Motif only).
91 @style{wxTHICK_FRAME}
92 Displays a thick frame around the window (Windows and Motif only).
93 @style{wxVSCROLL}
94 Displays a vertical scrollbar in the client window, allowing the
95 user to view child frames that are off the current view.
96 @style{wxFRAME_NO_WINDOW_MENU}
97 Under Windows, removes the Window menu that is normally added
98 automatically.
99 @endStyleTable
100
101 @library{wxcore}
102 @category{managedwnd}
103
104 @see wxMDIChildFrame, wxMDIClientWindow, wxFrame, wxDialog
105 */
106 class wxMDIParentFrame : public wxFrame
107 {
108 public:
109 //@{
110 /**
111 Constructor, creating the window.
112
113 @param parent
114 The window parent. This should be @NULL.
115 @param id
116 The window identifier. It may take a value of -1 to indicate a default
117 value.
118 @param title
119 The caption to be displayed on the frame's title bar.
120 @param pos
121 The window position. The value wxDefaultPosition indicates a default position,
122 chosen by
123 either the windowing system or wxWidgets, depending on platform.
124 @param size
125 The window size. The value wxDefaultSize indicates a default size, chosen by
126 either the windowing system or wxWidgets, depending on platform.
127 @param style
128 The window style. See wxMDIParentFrame.
129 @param name
130 The name of the window. This parameter is used to associate a name with the
131 item,
132 allowing the application user to set Motif resource values for
133 individual windows.
134
135 @remarks During the construction of the frame, the client window will be
136 created. To use a different class from
137 wxMDIClientWindow, override
138 OnCreateClient().
139
140 @see Create(), OnCreateClient()
141 */
142 wxMDIParentFrame();
143 wxMDIParentFrame(wxWindow* parent, wxWindowID id,
144 const wxString& title,
145 const wxPoint& pos = wxDefaultPosition,
146 const wxSize& size = wxDefaultSize,
147 long style = wxDEFAULT_FRAME_STYLE | wxVSCROLL | wxHSCROLL,
148 const wxString& name = "frame");
149 //@}
150
151 /**
152 Destructor. Destroys all child windows and menu bar if present.
153 */
154 ~wxMDIParentFrame();
155
156 /**
157 Activates the MDI child following the currently active one.
158
159 @see ActivatePrevious()
160 */
161 void ActivateNext();
162
163 /**
164 Activates the MDI child preceding the currently active one.
165
166 @see ActivateNext()
167 */
168 void ActivatePrevious();
169
170 /**
171 Arranges any iconized (minimized) MDI child windows.
172
173 @see Cascade(), Tile()
174 */
175 void ArrangeIcons();
176
177 /**
178 Arranges the MDI child windows in a cascade.
179
180 @see Tile(), ArrangeIcons()
181 */
182 void Cascade();
183
184 /**
185 Used in two-step frame construction. See wxMDIParentFrame()
186 for further details.
187 */
188 bool Create(wxWindow* parent, wxWindowID id,
189 const wxString& title,
190 const wxPoint& pos = wxDefaultPosition,
191 const wxSize& size = wxDefaultSize,
192 long style = wxDEFAULT_FRAME_STYLE | wxVSCROLL | wxHSCROLL,
193 const wxString& name = "frame");
194
195 /**
196 Returns a pointer to the active MDI child, if there is one.
197 */
198 wxMDIChildFrame* GetActiveChild() const;
199
200 /**
201 This gets the size of the frame 'client area' in pixels.
202
203 @param width
204 Receives the client width in pixels.
205 @param height
206 Receives the client height in pixels.
207
208 @remarks The client area is the area which may be drawn on by the
209 programmer, excluding title bar, border, status bar,
210 and toolbar if present.
211
212 @see GetToolBar(), SetToolBar(),
213 wxMDIClientWindow
214 */
215 virtual void GetClientSize(int* width, int* height) const;
216
217 /**
218 Returns a pointer to the client window.
219
220 @see OnCreateClient()
221 */
222 wxMDIClientWindow* GetClientWindow() const;
223
224 /**
225 Returns the window being used as the toolbar for this frame.
226
227 @see SetToolBar()
228 */
229 virtual wxWindow* GetToolBar() const;
230
231 /**
232 Returns the current Window menu (added by wxWidgets to the menubar). This
233 function
234 is available under Windows only.
235 */
236 wxMenu* GetWindowMenu() const;
237
238 /**
239 Override this to return a different kind of client window. If you override this
240 function,
241 you must create your parent frame in two stages, or your function will never be
242 called,
243 due to the way C++ treats virtual functions called from constructors. For
244 example:
245
246 @remarks You might wish to derive from wxMDIClientWindow in order to
247 implement different erase behaviour, for example, such
248 as painting a bitmap on the background.
249
250 @see GetClientWindow(), wxMDIClientWindow
251 */
252 virtual wxMDIClientWindow* OnCreateClient();
253
254 /**
255 Sets the window to be used as a toolbar for this
256 MDI parent window. It saves the application having to manage the positioning
257 of the toolbar MDI client window.
258
259 @param toolbar
260 Toolbar to manage.
261
262 @remarks When the frame is resized, the toolbar is resized to be the
263 width of the frame client area, and the toolbar height
264 is kept the same.
265
266 @see GetToolBar(), GetClientSize()
267 */
268 virtual void SetToolBar(wxWindow* toolbar);
269
270 /**
271 Call this to change the current Window menu. Ownership of the menu object
272 passes to
273 the frame when you call this function.
274 This call is available under Windows only.
275 To remove the window completely, use the wxFRAME_NO_WINDOW_MENU window style.
276 */
277 void SetWindowMenu(wxMenu* menu);
278
279 /**
280 Tiles the MDI child windows either horizontally or vertically depending on
281 whether @a orient is wxHORIZONTAL or wxVERTICAL.
282 Currently only implemented for MSW, does nothing under the other platforms.
283 */
284 void Tile(wxOrientation orient = wxHORIZONTAL);
285 };
286
287
288
289 /**
290 @class wxMDIChildFrame
291 @wxheader{mdi.h}
292
293 An MDI child frame is a frame that can only exist on a wxMDIClientWindow,
294 which is itself a child of wxMDIParentFrame.
295
296 @beginStyleTable
297 @style{wxCAPTION}
298 Puts a caption on the frame.
299 @style{wxDEFAULT_FRAME_STYLE}
300 Defined as wxMINIMIZE_BOX | wxMAXIMIZE_BOX | wxTHICK_FRAME |
301 wxSYSTEM_MENU | wxCAPTION.
302 @style{wxICONIZE}
303 Display the frame iconized (minimized) (Windows only).
304 @style{wxMAXIMIZE}
305 Displays the frame maximized (Windows only).
306 @style{wxMAXIMIZE_BOX}
307 Displays a maximize box on the frame (Windows and Motif only).
308 @style{wxMINIMIZE}
309 Identical to wxICONIZE.
310 @style{wxMINIMIZE_BOX}
311 Displays a minimize box on the frame (Windows and Motif only).
312 @style{wxRESIZE_BORDER}
313 Displays a resizeable border around the window (Motif only; for
314 Windows, it is implicit in wxTHICK_FRAME).
315 @style{wxSTAY_ON_TOP}
316 Stay on top of other windows (Windows only).
317 @style{wxSYSTEM_MENU}
318 Displays a system menu (Windows and Motif only).
319 @style{wxTHICK_FRAME}
320 Displays a thick frame around the window (Windows and Motif only).
321 @endStyleTable
322
323 @library{wxcore}
324 @category{managedwnd}
325
326 @see wxMDIClientWindow, wxMDIParentFrame, wxFrame
327 */
328 class wxMDIChildFrame : public wxFrame
329 {
330 public:
331 //@{
332 /**
333 Constructor, creating the window.
334
335 @param parent
336 The window parent. This should not be @NULL.
337 @param id
338 The window identifier. It may take a value of -1 to indicate a default
339 value.
340 @param title
341 The caption to be displayed on the frame's title bar.
342 @param pos
343 The window position. The value wxDefaultPosition indicates a default position,
344 chosen by
345 either the windowing system or wxWidgets, depending on platform.
346 @param size
347 The window size. The value wxDefaultSize indicates a default size, chosen by
348 either the windowing system or wxWidgets, depending on platform.
349 @param style
350 The window style. See wxMDIChildFrame.
351 @param name
352 The name of the window. This parameter is used to associate a name with the
353 item,
354 allowing the application user to set Motif resource values for
355 individual windows.
356
357 @remarks None.
358
359 @see Create()
360 */
361 wxMDIChildFrame();
362 wxMDIChildFrame(wxMDIParentFrame* parent, wxWindowID id,
363 const wxString& title,
364 const wxPoint& pos = wxDefaultPosition,
365 const wxSize& size = wxDefaultSize,
366 long style = wxDEFAULT_FRAME_STYLE,
367 const wxString& name = "frame");
368 //@}
369
370 /**
371 Destructor. Destroys all child windows and menu bar if present.
372 */
373 ~wxMDIChildFrame();
374
375 /**
376 Activates this MDI child frame.
377
378 @see Maximize(), Restore()
379 */
380 void Activate();
381
382 /**
383 Used in two-step frame construction. See wxMDIChildFrame()
384 for further details.
385 */
386 bool Create(wxWindow* parent, wxWindowID id,
387 const wxString& title,
388 const wxPoint& pos = wxDefaultPosition,
389 const wxSize& size = wxDefaultSize,
390 long style = wxDEFAULT_FRAME_STYLE,
391 const wxString& name = "frame");
392
393 /**
394 Maximizes this MDI child frame.
395
396 @see Activate(), Restore()
397 */
398 void Maximize(bool maximize);
399
400 /**
401 Restores this MDI child frame (unmaximizes).
402 */
403 void Restore();
404 };
405