]>
Commit | Line | Data |
---|---|---|
23324ae1 FM |
1 | ///////////////////////////////////////////////////////////////////////////// |
2 | // Name: mdi.h | |
e54c96f1 | 3 | // Purpose: interface of wxMDIClientWindow |
23324ae1 FM |
4 | // Author: wxWidgets team |
5 | // RCS-ID: $Id$ | |
6 | // Licence: wxWindows license | |
7 | ///////////////////////////////////////////////////////////////////////////// | |
8 | ||
9 | /** | |
10 | @class wxMDIClientWindow | |
11 | @wxheader{mdi.h} | |
7c913512 | 12 | |
23324ae1 FM |
13 | An MDI client window is a child of wxMDIParentFrame, and manages zero or |
14 | more wxMDIChildFrame objects. | |
7c913512 | 15 | |
23324ae1 FM |
16 | @library{wxcore} |
17 | @category{FIXME} | |
7c913512 | 18 | |
e54c96f1 | 19 | @see wxMDIChildFrame, wxMDIParentFrame, wxFrame |
23324ae1 FM |
20 | */ |
21 | class wxMDIClientWindow : public wxWindow | |
22 | { | |
23 | public: | |
24 | //@{ | |
25 | /** | |
26 | Constructor, creating the window. | |
3c4f71cc | 27 | |
7c913512 | 28 | @param parent |
4cc4bfaf | 29 | The window parent. |
7c913512 | 30 | @param style |
4cc4bfaf | 31 | The window style. Currently unused. |
3c4f71cc | 32 | |
23324ae1 | 33 | @remarks The second style of constructor is called within |
4cc4bfaf | 34 | wxMDIParentFrame::OnCreateClient. |
3c4f71cc | 35 | |
4cc4bfaf | 36 | @see wxMDIParentFrame::wxMDIParentFrame, wxMDIParentFrame::OnCreateClient |
23324ae1 FM |
37 | */ |
38 | wxMDIClientWindow(); | |
7c913512 | 39 | wxMDIClientWindow(wxMDIParentFrame* parent, long style = 0); |
23324ae1 FM |
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 | ||
e54c96f1 | 55 | |
23324ae1 FM |
56 | /** |
57 | @class wxMDIParentFrame | |
58 | @wxheader{mdi.h} | |
7c913512 | 59 | |
23324ae1 FM |
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). | |
7c913512 | 64 | |
23324ae1 | 65 | @beginStyleTable |
8c6791e4 | 66 | @style{wxCAPTION} |
23324ae1 | 67 | Puts a caption on the frame. |
8c6791e4 | 68 | @style{wxDEFAULT_FRAME_STYLE} |
7c913512 | 69 | Defined as wxMINIMIZE_BOX | wxMAXIMIZE_BOX | wxTHICK_FRAME | |
23324ae1 | 70 | wxSYSTEM_MENU | wxCAPTION. |
8c6791e4 | 71 | @style{wxHSCROLL} |
23324ae1 FM |
72 | Displays a horizontal scrollbar in the client window, allowing the |
73 | user to view child frames that are off the current view. | |
8c6791e4 | 74 | @style{wxICONIZE} |
23324ae1 | 75 | Display the frame iconized (minimized) (Windows only). |
8c6791e4 | 76 | @style{wxMAXIMIZE} |
23324ae1 | 77 | Displays the frame maximized (Windows only). |
8c6791e4 | 78 | @style{wxMAXIMIZE_BOX} |
23324ae1 | 79 | Displays a maximize box on the frame (Windows and Motif only). |
8c6791e4 | 80 | @style{wxMINIMIZE} |
23324ae1 | 81 | Identical to wxICONIZE. |
8c6791e4 | 82 | @style{wxMINIMIZE_BOX} |
23324ae1 | 83 | Displays a minimize box on the frame (Windows and Motif only). |
8c6791e4 | 84 | @style{wxRESIZE_BORDER} |
23324ae1 FM |
85 | Displays a resizeable border around the window (Motif only; for |
86 | Windows, it is implicit in wxTHICK_FRAME). | |
8c6791e4 | 87 | @style{wxSTAY_ON_TOP} |
23324ae1 | 88 | Stay on top of other windows (Windows only). |
8c6791e4 | 89 | @style{wxSYSTEM_MENU} |
23324ae1 | 90 | Displays a system menu (Windows and Motif only). |
8c6791e4 | 91 | @style{wxTHICK_FRAME} |
23324ae1 | 92 | Displays a thick frame around the window (Windows and Motif only). |
8c6791e4 | 93 | @style{wxVSCROLL} |
23324ae1 FM |
94 | Displays a vertical scrollbar in the client window, allowing the |
95 | user to view child frames that are off the current view. | |
8c6791e4 | 96 | @style{wxFRAME_NO_WINDOW_MENU} |
23324ae1 FM |
97 | Under Windows, removes the Window menu that is normally added |
98 | automatically. | |
99 | @endStyleTable | |
7c913512 | 100 | |
23324ae1 FM |
101 | @library{wxcore} |
102 | @category{managedwnd} | |
7c913512 | 103 | |
e54c96f1 | 104 | @see wxMDIChildFrame, wxMDIClientWindow, wxFrame, wxDialog |
23324ae1 FM |
105 | */ |
106 | class wxMDIParentFrame : public wxFrame | |
107 | { | |
108 | public: | |
109 | //@{ | |
110 | /** | |
111 | Constructor, creating the window. | |
3c4f71cc | 112 | |
7c913512 | 113 | @param parent |
4cc4bfaf | 114 | The window parent. This should be @NULL. |
7c913512 | 115 | @param id |
4cc4bfaf FM |
116 | The window identifier. It may take a value of -1 to indicate a default |
117 | value. | |
7c913512 | 118 | @param title |
4cc4bfaf | 119 | The caption to be displayed on the frame's title bar. |
7c913512 | 120 | @param pos |
4cc4bfaf FM |
121 | The window position. The value wxDefaultPosition indicates a default position, |
122 | chosen by | |
123 | either the windowing system or wxWidgets, depending on platform. | |
7c913512 | 124 | @param size |
4cc4bfaf FM |
125 | The window size. The value wxDefaultSize indicates a default size, chosen by |
126 | either the windowing system or wxWidgets, depending on platform. | |
7c913512 | 127 | @param style |
4cc4bfaf | 128 | The window style. See wxMDIParentFrame. |
7c913512 | 129 | @param name |
4cc4bfaf | 130 | The name of the window. This parameter is used to associate a name with the |
23324ae1 | 131 | item, |
4cc4bfaf FM |
132 | allowing the application user to set Motif resource values for |
133 | individual windows. | |
3c4f71cc | 134 | |
23324ae1 | 135 | @remarks During the construction of the frame, the client window will be |
4cc4bfaf FM |
136 | created. To use a different class from |
137 | wxMDIClientWindow, override | |
138 | OnCreateClient(). | |
3c4f71cc | 139 | |
4cc4bfaf | 140 | @see Create(), OnCreateClient() |
23324ae1 FM |
141 | */ |
142 | wxMDIParentFrame(); | |
7c913512 FM |
143 | wxMDIParentFrame(wxWindow* parent, wxWindowID id, |
144 | const wxString& title, | |
145 | const wxPoint& pos = wxDefaultPosition, | |
146 | const wxSize& size = wxDefaultSize, | |
4cc4bfaf | 147 | long style = wxDEFAULT_FRAME_STYLE | wxVSCROLL | wxHSCROLL, |
7c913512 | 148 | const wxString& name = "frame"); |
23324ae1 FM |
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. | |
3c4f71cc | 158 | |
4cc4bfaf | 159 | @see ActivatePrevious() |
23324ae1 FM |
160 | */ |
161 | void ActivateNext(); | |
162 | ||
163 | /** | |
164 | Activates the MDI child preceding the currently active one. | |
3c4f71cc | 165 | |
4cc4bfaf | 166 | @see ActivateNext() |
23324ae1 FM |
167 | */ |
168 | void ActivatePrevious(); | |
169 | ||
170 | /** | |
171 | Arranges any iconized (minimized) MDI child windows. | |
3c4f71cc | 172 | |
4cc4bfaf | 173 | @see Cascade(), Tile() |
23324ae1 FM |
174 | */ |
175 | void ArrangeIcons(); | |
176 | ||
177 | /** | |
178 | Arranges the MDI child windows in a cascade. | |
3c4f71cc | 179 | |
4cc4bfaf | 180 | @see Tile(), ArrangeIcons() |
23324ae1 FM |
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, | |
4cc4bfaf | 192 | long style = wxDEFAULT_FRAME_STYLE | wxVSCROLL | wxHSCROLL, |
23324ae1 FM |
193 | const wxString& name = "frame"); |
194 | ||
195 | /** | |
196 | Returns a pointer to the active MDI child, if there is one. | |
197 | */ | |
328f5751 | 198 | wxMDIChildFrame* GetActiveChild() const; |
23324ae1 FM |
199 | |
200 | /** | |
201 | This gets the size of the frame 'client area' in pixels. | |
3c4f71cc | 202 | |
7c913512 | 203 | @param width |
4cc4bfaf | 204 | Receives the client width in pixels. |
7c913512 | 205 | @param height |
4cc4bfaf | 206 | Receives the client height in pixels. |
3c4f71cc | 207 | |
23324ae1 | 208 | @remarks The client area is the area which may be drawn on by the |
4cc4bfaf FM |
209 | programmer, excluding title bar, border, status bar, |
210 | and toolbar if present. | |
3c4f71cc | 211 | |
4cc4bfaf FM |
212 | @see GetToolBar(), SetToolBar(), |
213 | wxMDIClientWindow | |
23324ae1 | 214 | */ |
328f5751 | 215 | virtual void GetClientSize(int* width, int* height) const; |
23324ae1 FM |
216 | |
217 | /** | |
218 | Returns a pointer to the client window. | |
3c4f71cc | 219 | |
4cc4bfaf | 220 | @see OnCreateClient() |
23324ae1 | 221 | */ |
328f5751 | 222 | wxMDIClientWindow* GetClientWindow() const; |
23324ae1 FM |
223 | |
224 | /** | |
225 | Returns the window being used as the toolbar for this frame. | |
3c4f71cc | 226 | |
4cc4bfaf | 227 | @see SetToolBar() |
23324ae1 | 228 | */ |
328f5751 | 229 | virtual wxWindow* GetToolBar() const; |
23324ae1 FM |
230 | |
231 | /** | |
232 | Returns the current Window menu (added by wxWidgets to the menubar). This | |
233 | function | |
234 | is available under Windows only. | |
235 | */ | |
328f5751 | 236 | wxMenu* GetWindowMenu() const; |
23324ae1 FM |
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: | |
3c4f71cc | 245 | |
23324ae1 | 246 | @remarks You might wish to derive from wxMDIClientWindow in order to |
4cc4bfaf FM |
247 | implement different erase behaviour, for example, such |
248 | as painting a bitmap on the background. | |
3c4f71cc | 249 | |
4cc4bfaf | 250 | @see GetClientWindow(), wxMDIClientWindow |
23324ae1 FM |
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. | |
3c4f71cc | 258 | |
7c913512 | 259 | @param toolbar |
4cc4bfaf | 260 | Toolbar to manage. |
3c4f71cc | 261 | |
23324ae1 | 262 | @remarks When the frame is resized, the toolbar is resized to be the |
4cc4bfaf FM |
263 | width of the frame client area, and the toolbar height |
264 | is kept the same. | |
3c4f71cc | 265 | |
4cc4bfaf | 266 | @see GetToolBar(), GetClientSize() |
23324ae1 FM |
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. | |
23324ae1 | 274 | This call is available under Windows only. |
23324ae1 FM |
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 | |
4cc4bfaf | 281 | whether @a orient is wxHORIZONTAL or wxVERTICAL. |
23324ae1 FM |
282 | Currently only implemented for MSW, does nothing under the other platforms. |
283 | */ | |
284 | void Tile(wxOrientation orient = wxHORIZONTAL); | |
285 | }; | |
286 | ||
287 | ||
e54c96f1 | 288 | |
23324ae1 FM |
289 | /** |
290 | @class wxMDIChildFrame | |
291 | @wxheader{mdi.h} | |
7c913512 | 292 | |
23324ae1 FM |
293 | An MDI child frame is a frame that can only exist on a wxMDIClientWindow, |
294 | which is itself a child of wxMDIParentFrame. | |
7c913512 | 295 | |
23324ae1 | 296 | @beginStyleTable |
8c6791e4 | 297 | @style{wxCAPTION} |
23324ae1 | 298 | Puts a caption on the frame. |
8c6791e4 | 299 | @style{wxDEFAULT_FRAME_STYLE} |
7c913512 | 300 | Defined as wxMINIMIZE_BOX | wxMAXIMIZE_BOX | wxTHICK_FRAME | |
23324ae1 | 301 | wxSYSTEM_MENU | wxCAPTION. |
8c6791e4 | 302 | @style{wxICONIZE} |
23324ae1 | 303 | Display the frame iconized (minimized) (Windows only). |
8c6791e4 | 304 | @style{wxMAXIMIZE} |
23324ae1 | 305 | Displays the frame maximized (Windows only). |
8c6791e4 | 306 | @style{wxMAXIMIZE_BOX} |
23324ae1 | 307 | Displays a maximize box on the frame (Windows and Motif only). |
8c6791e4 | 308 | @style{wxMINIMIZE} |
23324ae1 | 309 | Identical to wxICONIZE. |
8c6791e4 | 310 | @style{wxMINIMIZE_BOX} |
23324ae1 | 311 | Displays a minimize box on the frame (Windows and Motif only). |
8c6791e4 | 312 | @style{wxRESIZE_BORDER} |
23324ae1 FM |
313 | Displays a resizeable border around the window (Motif only; for |
314 | Windows, it is implicit in wxTHICK_FRAME). | |
8c6791e4 | 315 | @style{wxSTAY_ON_TOP} |
23324ae1 | 316 | Stay on top of other windows (Windows only). |
8c6791e4 | 317 | @style{wxSYSTEM_MENU} |
23324ae1 | 318 | Displays a system menu (Windows and Motif only). |
8c6791e4 | 319 | @style{wxTHICK_FRAME} |
23324ae1 FM |
320 | Displays a thick frame around the window (Windows and Motif only). |
321 | @endStyleTable | |
7c913512 | 322 | |
23324ae1 FM |
323 | @library{wxcore} |
324 | @category{managedwnd} | |
7c913512 | 325 | |
e54c96f1 | 326 | @see wxMDIClientWindow, wxMDIParentFrame, wxFrame |
23324ae1 FM |
327 | */ |
328 | class wxMDIChildFrame : public wxFrame | |
329 | { | |
330 | public: | |
331 | //@{ | |
332 | /** | |
333 | Constructor, creating the window. | |
3c4f71cc | 334 | |
7c913512 | 335 | @param parent |
4cc4bfaf | 336 | The window parent. This should not be @NULL. |
7c913512 | 337 | @param id |
4cc4bfaf FM |
338 | The window identifier. It may take a value of -1 to indicate a default |
339 | value. | |
7c913512 | 340 | @param title |
4cc4bfaf | 341 | The caption to be displayed on the frame's title bar. |
7c913512 | 342 | @param pos |
4cc4bfaf FM |
343 | The window position. The value wxDefaultPosition indicates a default position, |
344 | chosen by | |
345 | either the windowing system or wxWidgets, depending on platform. | |
7c913512 | 346 | @param size |
4cc4bfaf FM |
347 | The window size. The value wxDefaultSize indicates a default size, chosen by |
348 | either the windowing system or wxWidgets, depending on platform. | |
7c913512 | 349 | @param style |
4cc4bfaf | 350 | The window style. See wxMDIChildFrame. |
7c913512 | 351 | @param name |
4cc4bfaf | 352 | The name of the window. This parameter is used to associate a name with the |
23324ae1 | 353 | item, |
4cc4bfaf FM |
354 | allowing the application user to set Motif resource values for |
355 | individual windows. | |
3c4f71cc | 356 | |
23324ae1 | 357 | @remarks None. |
3c4f71cc | 358 | |
4cc4bfaf | 359 | @see Create() |
23324ae1 FM |
360 | */ |
361 | wxMDIChildFrame(); | |
7c913512 FM |
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"); | |
23324ae1 FM |
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. | |
3c4f71cc | 377 | |
4cc4bfaf | 378 | @see Maximize(), Restore() |
23324ae1 FM |
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. | |
3c4f71cc | 395 | |
4cc4bfaf | 396 | @see Activate(), Restore() |
23324ae1 FM |
397 | */ |
398 | void Maximize(bool maximize); | |
399 | ||
400 | /** | |
401 | Restores this MDI child frame (unmaximizes). | |
402 | */ | |
403 | void Restore(); | |
404 | }; | |
e54c96f1 | 405 |