]>
git.saurik.com Git - wxWidgets.git/blob - interface/mdi.h
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: interface of wxMDIClientWindow
4 // Author: wxWidgets team
6 // Licence: wxWindows license
7 /////////////////////////////////////////////////////////////////////////////
10 @class wxMDIClientWindow
13 An MDI client window is a child of wxMDIParentFrame, and manages zero or
14 more wxMDIChildFrame objects.
19 @see wxMDIChildFrame, wxMDIParentFrame, wxFrame
21 class wxMDIClientWindow
: public wxWindow
26 Constructor, creating the window.
31 The window style. Currently unused.
33 @remarks The second style of constructor is called within
34 wxMDIParentFrame::OnCreateClient.
36 @see wxMDIParentFrame::wxMDIParentFrame, wxMDIParentFrame::OnCreateClient
39 wxMDIClientWindow(wxMDIParentFrame
* parent
, long style
= 0);
48 Used in two-step frame construction. See wxMDIClientWindow()
51 bool CreateClient(wxMDIParentFrame
* parent
, long style
= 0);
57 @class wxMDIParentFrame
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
63 and is used in many popular Windows applications, such as Microsoft Word(TM).
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.
72 Displays a horizontal scrollbar in the client window, allowing the
73 user to view child frames that are off the current view.
75 Display the frame iconized (minimized) (Windows only).
77 Displays the frame maximized (Windows only).
78 @style{wxMAXIMIZE_BOX}:
79 Displays a maximize box on the frame (Windows and Motif only).
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).
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
102 @category{managedwnd}
104 @see wxMDIChildFrame, wxMDIClientWindow, wxFrame, wxDialog
106 class wxMDIParentFrame
: public wxFrame
111 Constructor, creating the window.
114 The window parent. This should be @NULL.
116 The window identifier. It may take a value of -1 to indicate a default
119 The caption to be displayed on the frame's title bar.
121 The window position. The value wxDefaultPosition indicates a default position,
123 either the windowing system or wxWidgets, depending on platform.
125 The window size. The value wxDefaultSize indicates a default size, chosen by
126 either the windowing system or wxWidgets, depending on platform.
128 The window style. See wxMDIParentFrame.
130 The name of the window. This parameter is used to associate a name with the
132 allowing the application user to set Motif resource values for
135 @remarks During the construction of the frame, the client window will be
136 created. To use a different class from
137 wxMDIClientWindow, override
140 @see Create(), OnCreateClient()
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");
152 Destructor. Destroys all child windows and menu bar if present.
157 Activates the MDI child following the currently active one.
159 @see ActivatePrevious()
164 Activates the MDI child preceding the currently active one.
168 void ActivatePrevious();
171 Arranges any iconized (minimized) MDI child windows.
173 @see Cascade(), Tile()
178 Arranges the MDI child windows in a cascade.
180 @see Tile(), ArrangeIcons()
185 Used in two-step frame construction. See wxMDIParentFrame()
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");
196 Returns a pointer to the active MDI child, if there is one.
198 wxMDIChildFrame
* GetActiveChild() const;
201 This gets the size of the frame 'client area' in pixels.
204 Receives the client width in pixels.
206 Receives the client height in pixels.
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.
212 @see GetToolBar(), SetToolBar(),
215 virtual void GetClientSize(int* width
, int* height
) const;
218 Returns a pointer to the client window.
220 @see OnCreateClient()
222 wxMDIClientWindow
* GetClientWindow() const;
225 Returns the window being used as the toolbar for this frame.
229 virtual wxWindow
* GetToolBar() const;
232 Returns the current Window menu (added by wxWidgets to the menubar). This
234 is available under Windows only.
236 wxMenu
* GetWindowMenu() const;
239 Override this to return a different kind of client window. If you override this
241 you must create your parent frame in two stages, or your function will never be
243 due to the way C++ treats virtual functions called from constructors. For
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.
250 @see GetClientWindow(), wxMDIClientWindow
252 virtual wxMDIClientWindow
* OnCreateClient();
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.
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
266 @see GetToolBar(), GetClientSize()
268 virtual void SetToolBar(wxWindow
* toolbar
);
271 Call this to change the current Window menu. Ownership of the menu object
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.
277 void SetWindowMenu(wxMenu
* menu
);
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.
284 void Tile(wxOrientation orient
= wxHORIZONTAL
);
290 @class wxMDIChildFrame
293 An MDI child frame is a frame that can only exist on a wxMDIClientWindow,
294 which is itself a child of wxMDIParentFrame.
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.
303 Display the frame iconized (minimized) (Windows only).
305 Displays the frame maximized (Windows only).
306 @style{wxMAXIMIZE_BOX}:
307 Displays a maximize box on the frame (Windows and Motif only).
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).
324 @category{managedwnd}
326 @see wxMDIClientWindow, wxMDIParentFrame, wxFrame
328 class wxMDIChildFrame
: public wxFrame
333 Constructor, creating the window.
336 The window parent. This should not be @NULL.
338 The window identifier. It may take a value of -1 to indicate a default
341 The caption to be displayed on the frame's title bar.
343 The window position. The value wxDefaultPosition indicates a default position,
345 either the windowing system or wxWidgets, depending on platform.
347 The window size. The value wxDefaultSize indicates a default size, chosen by
348 either the windowing system or wxWidgets, depending on platform.
350 The window style. See wxMDIChildFrame.
352 The name of the window. This parameter is used to associate a name with the
354 allowing the application user to set Motif resource values for
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");
371 Destructor. Destroys all child windows and menu bar if present.
376 Activates this MDI child frame.
378 @see Maximize(), Restore()
383 Used in two-step frame construction. See wxMDIChildFrame()
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");
394 Maximizes this MDI child frame.
396 @see Activate(), Restore()
398 void Maximize(bool maximize
);
401 Restores this MDI child frame (unmaximizes).