1 \section{\class{wxMDIChildFrame
}}\label{wxmdichildframe
}
3 An MDI child frame is a frame that can only exist on a
\helpref{wxMDIClientWindow
}{wxmdiclientwindow
},
4 which is itself a child of
\helpref{wxMDIParentFrame
}{wxmdiparentframe
}.
6 \wxheading{Derived from
}
8 \helpref{wxFrame
}{wxframe
}\\
9 \helpref{wxWindow
}{wxwindow
}\\
10 \helpref{wxEvtHandler
}{wxevthandler
}\\
11 \helpref{wxObject
}{wxobject
}
13 \wxheading{Window styles
}
16 \begin{twocollist
}\itemsep=
0pt
17 \twocolitem{\windowstyle{wxCAPTION
}}{Puts a caption on the frame.
}
18 \twocolitem{\windowstyle{wxDEFAULT
\_FRAME\_STYLE}}{Defined as
{\bf wxMINIMIZE
\_BOX \pipe wxMAXIMIZE
\_BOX \pipe wxTHICK
\_FRAME \pipe wxSYSTEM
\_MENU \pipe wxCAPTION
}.
}
19 \twocolitem{\windowstyle{wxICONIZE
}}{Display the frame iconized (minimized) (Windows only).
}
20 \twocolitem{\windowstyle{wxMAXIMIZE
}}{Displays the frame maximized (Windows only).
}
21 \twocolitem{\windowstyle{wxMAXIMIZE
\_BOX}}{Displays a maximize box on the frame (Windows and Motif only).
}
22 \twocolitem{\windowstyle{wxMINIMIZE
}}{Identical to
{\bf wxICONIZE
}.
}
23 \twocolitem{\windowstyle{wxMINIMIZE
\_BOX}}{Displays a minimize box on the frame (Windows and Motif only).
}
24 \twocolitem{\windowstyle{wxRESIZE
\_BORDER}}{Displays a resizeable border around the window (Motif only;
25 for Windows, it is implicit in wxTHICK
\_FRAME).
}
26 \twocolitem{\windowstyle{wxSTAY
\_ON\_TOP}}{Stay on top of other windows (Windows only).
}
27 \twocolitem{\windowstyle{wxSYSTEM
\_MENU}}{Displays a system menu (Windows and Motif only).
}
28 \twocolitem{\windowstyle{wxTHICK
\_FRAME}}{Displays a thick frame around the window (Windows and Motif only).
}
31 See also
\helpref{window styles overview
}{windowstyles
}.
35 Although internally an MDI child frame is a child of the MDI client window, in wxWindows
36 you create it as a child of
\helpref{wxMDIParentFrame
}{wxmdiparentframe
}. You can usually
37 forget that the client window exists.
39 MDI child frames are clipped to the area of the MDI client window, and may be iconized
42 You can associate a menubar with a child frame as usual, although an MDI child doesn't display
43 its menubar under its own title bar. The MDI parent frame's menubar will be changed to
44 reflect the currently active child frame. If there are currently no children, the parent
45 frame's own menubar will be displayed.
49 \helpref{wxMDIClientWindow
}{wxmdiclientwindow
},
\helpref{wxMDIParentFrame
}{wxmdiparentframe
},
\rtfsp
50 \helpref{wxFrame
}{wxframe
}
52 \latexignore{\rtfignore{\wxheading{Members
}}}
54 \membersection{wxMDIChildFrame::wxMDIChildFrame
}\label{wxmdichildframeconstr
}
56 \func{}{wxMDIChildFrame
}{\void}
60 \func{}{wxMDIChildFrame
}{\param{wxMDIParentFrame*
}{parent
},
\param{wxWindowID
}{id
},
\rtfsp
61 \param{const wxString\&
}{title
},
\param{const wxPoint\&
}{ pos = wxDefaultPosition
},
\rtfsp
62 \param{const wxSize\&
}{ size = wxDefaultSize
},
\param{long
}{ style = wxDEFAULT
\_FRAME\_STYLE},
\rtfsp
63 \param{const wxString\&
}{name = ``frame"
}}
65 Constructor, creating the window.
67 \wxheading{Parameters
}
69 \docparam{parent
}{The window parent. This should not be NULL.
}
71 \docparam{id
}{The window identifier. It may take a value of -
1 to indicate a default value.
}
73 \docparam{title
}{The caption to be displayed on the frame's title bar.
}
75 \docparam{pos
}{The window position. A value of (-
1, -
1) indicates a default position, chosen by
76 either the windowing system or wxWindows, depending on platform.
}
78 \docparam{size
}{The window size. A value of (-
1, -
1) indicates a default size, chosen by
79 either the windowing system or wxWindows, depending on platform.
}
81 \docparam{style
}{The window style. See
\helpref{wxMDIChildFrame
}{wxmdichildframe
}.
}
83 \docparam{name
}{The name of the window. This parameter is used to associate a name with the item,
84 allowing the application user to set Motif resource values for
93 \helpref{wxMDIChildFrame::Create
}{wxmdichildframecreate
}
95 \membersection{wxMDIChildFrame::
\destruct{wxMDIChildFrame
}}
97 \func{}{\destruct{wxMDIChildFrame
}}{\void}
99 Destructor. Destroys all child windows and menu bar if present.
101 \membersection{wxMDIChildFrame::Activate
}\label{wxmdichildframeactivate
}
103 \func{void
}{Activate
}{\void}
105 Activates this MDI child frame.
109 \helpref{wxMDIChildFrame::Maximize
}{wxmdichildframemaximize
},
\rtfsp
110 \helpref{wxMDIChildFrame::Restore
}{wxmdichildframerestore
}
112 \membersection{wxMDIChildFrame::Create
}\label{wxmdichildframecreate
}
114 \func{bool
}{Create
}{\param{wxWindow*
}{parent
},
\param{wxWindowID
}{id
},
\rtfsp
115 \param{const wxString\&
}{title
},
\param{const wxPoint\&
}{ pos = wxDefaultPosition
},
\rtfsp
116 \param{const wxSize\&
}{ size = wxDefaultSize
},
\param{long
}{ style = wxDEFAULT
\_FRAME\_STYLE},
\rtfsp
117 \param{const wxString\&
}{name = ``frame"
}}
119 Used in two-step frame construction. See
\helpref{wxMDIChildFrame::wxMDIChildFrame
}{wxmdichildframeconstr
}\rtfsp
122 \membersection{wxMDIChildFrame::Maximize
}\label{wxmdichildframemaximize
}
124 \func{void
}{Maximize
}{\void}
126 Maximizes this MDI child frame.
130 \helpref{wxMDIChildFrame::Activate
}{wxmdichildframeactivate
},
\rtfsp
131 \helpref{wxMDIChildFrame::Restore
}{wxmdichildframerestore
}
133 \membersection{wxMDIChildFrame::Restore
}\label{wxmdichildframerestore
}
135 \func{void
}{Restore
}{\void}
137 Restores this MDI child frame (unmaximizes).
141 \helpref{wxMDIChildFrame::Activate
}{wxmdichildframeactivate
},
\rtfsp
142 \helpref{wxMDIChildFrame::Maximize
}{wxmdichildframemaximize
}
145 \section{\class{wxMDIClientWindow
}}\label{wxmdiclientwindow
}
147 An MDI client window is a child of
\helpref{wxMDIParentFrame
}{wxmdiparentframe
}, and manages zero or
148 more
\helpref{wxMDIChildFrame
}{wxmdichildframe
} objects.
150 \wxheading{Derived from
}
152 \helpref{wxWindow
}{wxwindow
}\\
153 \helpref{wxEvtHandler
}{wxevthandler
}\\
154 \helpref{wxObject
}{wxobject
}
158 The client window is the area where MDI child windows exist. It doesn't have to cover the whole
159 parent frame; other windows such as toolbars and a help window might coexist with it.
160 There can be scrollbars on a client window, which are controlled by the parent window style.
162 The
{\bf wxMDIClientWindow
} class is usually adequate without further derivation, and it is created
163 automatically when the MDI parent frame is created. If the application needs to derive a new class,
164 the function
\helpref{wxMDIParentFrame::OnCreateClient
}{wxmdiparentframeoncreateclient
} must be
165 overridden in order to give an opportunity to use a different class of client window.
167 Under Windows
95, the client window will automatically have a sunken border style when
168 the active child is not maximized, and no border style when a child is maximized.
172 \helpref{wxMDIChildFrame
}{wxmdichildframe
},
\helpref{wxMDIParentFrame
}{wxmdiparentframe
},
\rtfsp
173 \helpref{wxFrame
}{wxframe
}
175 \latexignore{\rtfignore{\wxheading{Members
}}}
177 \membersection{wxMDIClientWindow::wxMDIClientWindow
}\label{wxmdiclientwindowconstr
}
179 \func{}{wxMDIClientWindow
}{\void}
183 \func{}{wxMDIClientWindow
}{\param{wxMDIParentFrame*
}{parent
},
\param{long
}{ style =
0}}
185 Constructor, creating the window.
187 \wxheading{Parameters
}
189 \docparam{parent
}{The window parent.
}
191 \docparam{style
}{The window style. Currently unused.
}
195 The second style of constructor is called within
\helpref{wxMDIParentFrame::OnCreateClient
}{wxmdiparentframeoncreateclient
}.
199 \helpref{wxMDIParentFrame::wxMDIParentFrame
}{wxmdiparentframeconstr
},
\rtfsp
200 \helpref{wxMDIParentFrame::OnCreateClient
}{wxmdiparentframeoncreateclient
}
202 \membersection{wxMDIClientWindow::
\destruct{wxMDIClientWindow
}}
204 \func{}{\destruct{wxMDIClientWindow
}}{\void}
208 \membersection{wxMDIClientWindow::CreateClient
}\label{wxmdiclientwindowcreateclient
}
210 \func{bool
}{CreateClient
}{\param{wxMDIParentFrame*
}{parent
},
\param{long
}{ style =
0}}
212 Used in two-step frame construction. See
\helpref{wxMDIClientWindow::wxMDIClientWindow
}{wxmdiclientwindowconstr
}\rtfsp
215 \section{\class{wxMDIParentFrame
}}\label{wxmdiparentframe
}
217 An MDI (Multiple Document Interface) parent frame is a window which can contain
218 MDI child frames in its own `desktop'. It is a convenient way to avoid window clutter,
219 and is used in many popular Windows applications, such as Microsoft Word(TM).
221 \wxheading{Derived from
}
223 \helpref{wxFrame
}{wxframe
}\\
224 \helpref{wxWindow
}{wxwindow
}\\
225 \helpref{wxEvtHandler
}{wxevthandler
}\\
226 \helpref{wxObject
}{wxobject
}
230 There may be multiple MDI parent frames in a single application, but this probably only makes sense
231 within programming development environments.
233 Child frames may be either
\helpref{wxMDIChildFrame
}{wxmdichildframe
}, or
\helpref{wxFrame
}{wxframe
}.
235 An MDI parent frame always has a
\helpref{wxMDIClientWindow
}{wxmdiclientwindow
} associated with it, which
236 is the parent for MDI client frames.
237 This client window may be resized to accomodate non-MDI windows, as seen in Microsoft Visual C++ (TM) and
238 Microsoft Publisher (TM), where a documentation window is placed to one side of the workspace.
240 MDI remains popular despite dire warnings from Microsoft itself that MDI is an obsolete
241 user interface style.
243 The implementation is native in Windows, and simulated under Motif. Under Motif,
244 the child window frames will often have a different appearance from other frames
245 because the window decorations are simulated.
247 \wxheading{Window styles
}
250 \begin{twocollist
}\itemsep=
0pt
251 \twocolitem{\windowstyle{wxCAPTION
}}{Puts a caption on the frame.
}
252 \twocolitem{\windowstyle{wxDEFAULT
\_FRAME\_STYLE}}{Defined as
{\bf wxMINIMIZE
\_BOX \pipe wxMAXIMIZE
\_BOX \pipe wxTHICK
\_FRAME \pipe wxSYSTEM
\_MENU \pipe wxCAPTION
}.
}
253 \twocolitem{\windowstyle{wxHSCROLL
}}{Displays a horizontal scrollbar in the
{\it client window
}, allowing
254 the user to view child frames that are off the current view.
}
255 \twocolitem{\windowstyle{wxICONIZE
}}{Display the frame iconized (minimized) (Windows only).
}
256 \twocolitem{\windowstyle{wxMAXIMIZE
}}{Displays the frame maximized (Windows only).
}
257 \twocolitem{\windowstyle{wxMAXIMIZE
\_BOX}}{Displays a maximize box on the frame (Windows and Motif only).
}
258 \twocolitem{\windowstyle{wxMINIMIZE
}}{Identical to
{\bf wxICONIZE
}.
}
259 \twocolitem{\windowstyle{wxMINIMIZE
\_BOX}}{Displays a minimize box on the frame (Windows and Motif only).
}
260 \twocolitem{\windowstyle{wxRESIZE
\_BORDER}}{Displays a resizeable border around the window (Motif only;
261 for Windows, it is implicit in wxTHICK
\_FRAME).
}
262 \twocolitem{\windowstyle{wxSTAY
\_ON\_TOP}}{Stay on top of other windows (Windows only).
}
263 \twocolitem{\windowstyle{wxSYSTEM
\_MENU}}{Displays a system menu (Windows and Motif only).
}
264 \twocolitem{\windowstyle{wxTHICK
\_FRAME}}{Displays a thick frame around the window (Windows and Motif only).
}
265 \twocolitem{\windowstyle{wxVSCROLL
}}{Displays a vertical scrollbar in the
{\it client window
}, allowing
266 the user to view child frames that are off the current view.
}
269 See also
\helpref{window styles overview
}{windowstyles
}.
273 \helpref{wxMDIChildFrame
}{wxmdichildframe
},
\helpref{wxMDIClientWindow
}{wxmdiclientwindow
},
\rtfsp
274 \helpref{wxFrame
}{wxframe
},
\helpref{wxDialog
}{wxdialog
}
276 \latexignore{\rtfignore{\wxheading{Members
}}}
278 \membersection{wxMDIParentFrame::wxMDIParentFrame
}\label{wxmdiparentframeconstr
}
280 \func{}{wxMDIParentFrame
}{\void}
284 \func{}{wxMDIParentFrame
}{\param{wxWindow*
}{parent
},
\param{wxWindowID
}{id
},
\rtfsp
285 \param{const wxString\&
}{title
},
\param{const wxPoint\&
}{ pos = wxDefaultPosition
},
\rtfsp
286 \param{const wxSize\&
}{ size = wxDefaultSize
},
\param{long
}{ style = wxDEFAULT
\_FRAME\_STYLE \pipe wxVSCROLL
\pipe wxHSCROLL
},
\rtfsp
287 \param{const wxString\&
}{name = ``frame"
}}
289 Constructor, creating the window.
291 \wxheading{Parameters
}
293 \docparam{parent
}{The window parent. This should be NULL.
}
295 \docparam{id
}{The window identifier. It may take a value of -
1 to indicate a default value.
}
297 \docparam{title
}{The caption to be displayed on the frame's title bar.
}
299 \docparam{pos
}{The window position. A value of (-
1, -
1) indicates a default position, chosen by
300 either the windowing system or wxWindows, depending on platform.
}
302 \docparam{size
}{The window size. A value of (-
1, -
1) indicates a default size, chosen by
303 either the windowing system or wxWindows, depending on platform.
}
305 \docparam{style
}{The window style. See
\helpref{wxMDIParentFrame
}{wxmdiparentframe
}.
}
307 \docparam{name
}{The name of the window. This parameter is used to associate a name with the item,
308 allowing the application user to set Motif resource values for
313 During the construction of the frame, the client window will be created. To use a different class
314 from
\helpref{wxMDIClientWindow
}{wxmdiclientwindow
}, override
\rtfsp
315 \helpref{wxMDIParentFrame::OnCreateClient
}{wxmdiparentframeoncreateclient
}.
317 Under Windows
95, the client window will automatically have a sunken border style when
318 the active child is not maximized, and no border style when a child is maximized.
322 \helpref{wxMDIParentFrame::Create
}{wxmdiparentframecreate
},
\rtfsp
323 \helpref{wxMDIParentFrame::OnCreateClient
}{wxmdiparentframeoncreateclient
}
325 \membersection{wxMDIParentFrame::
\destruct{wxMDIParentFrame
}}
327 \func{}{\destruct{wxMDIParentFrame
}}{\void}
329 Destructor. Destroys all child windows and menu bar if present.
331 \membersection{wxMDIParentFrame::ActivateNext
}\label{wxmdiparentframeactivatenext
}
333 \func{void
}{ActivateNext
}{\void}
335 Activates the MDI child following the currently active one.
339 \helpref{wxMDIParentFrame::ActivatePrevious
}{wxmdiparentframeactivateprevious
}
341 \membersection{wxMDIParentFrame::ActivatePrevious
}\label{wxmdiparentframeactivateprevious
}
343 \func{void
}{ActivatePrevious
}{\void}
345 Activates the MDI child preceding the currently active one.
349 \helpref{wxMDIParentFrame::ActivateNext
}{wxmdiparentframeactivatenext
}
352 \membersection{wxMDIParentFrame::ArrangeIcons
}\label{wxmdiparentframearrangeicons
}
354 \func{void
}{ArrangeIcons
}{\void}
356 Arranges any iconized (minimized) MDI child windows.
360 \helpref{wxMDIParentFrame::Cascade
}{wxmdiparentframecascade
},
\rtfsp
361 \helpref{wxMDIParentFrame::Tile
}{wxmdiparentframetile
}
363 \membersection{wxMDIParentFrame::Cascade
}\label{wxmdiparentframecascade
}
365 \func{void
}{Cascade
}{\void}
367 Arranges the MDI child windows in a cascade.
371 \helpref{wxMDIParentFrame::Tile
}{wxmdiparentframetile
},
\rtfsp
372 \helpref{wxMDIParentFrame::ArrangeIcons
}{wxmdiparentframearrangeicons
}
374 \membersection{wxMDIParentFrame::Create
}\label{wxmdiparentframecreate
}
376 \func{bool
}{Create
}{\param{wxWindow*
}{parent
},
\param{wxWindowID
}{id
},
\rtfsp
377 \param{const wxString\&
}{title
},
\param{const wxPoint\&
}{ pos = wxDefaultPosition
},
\rtfsp
378 \param{const wxSize\&
}{ size = wxDefaultSize
},
\param{long
}{ style = wxDEFAULT
\_FRAME\_STYLE \pipe wxVSCROLL
\pipe wxHSCROLL
},
\rtfsp
379 \param{const wxString\&
}{name = ``frame"
}}
381 Used in two-step frame construction. See
\helpref{wxMDIParentFrame::wxMDIParentFrame
}{wxmdiparentframeconstr
}\rtfsp
384 \membersection{wxMDIParentFrame::GetClientSize
}\label{wxmdiparentframegetclientsize
}
386 \constfunc{virtual void
}{GetClientSize
}{\param{int*
}{width
},
\param{int*
}{height
}}
388 This gets the size of the frame `client area' in pixels.
390 \wxheading{Parameters
}
392 \docparam{width
}{Receives the client width in pixels.
}
394 \docparam{height
}{Receives the client height in pixels.
}
398 The client area is the area which may be drawn on by the programmer, excluding title bar, border, status bar,
399 and toolbar if present.
401 If you wish to manage your own toolbar (or perhaps you have more than one),
402 provide an
{\bf OnSize
} event handler. Call
{\bf GetClientSize
} to
403 find how much space there is for your windows and don't forget to set the size and position
404 of the MDI client window as well as your toolbar and other windows (but not the status bar).
406 If you have set a toolbar with
\helpref{wxMDIParentFrame::SetToolbar
}{wxmdiparentframesettoolbar
},
407 the client size returned will have subtracted the toolbar height. However, the available positions
408 for the client window and other windows of the frame do not start at zero - you must add the toolbar height.
410 The position and size of the status bar and toolbar (if known to the frame) are always managed
411 by
{\bf wxMDIParentFrame
}, regardless of what behaviour is defined in your
{\bf OnSize
} event handler.
412 However, the client window position and size are always set in
{\bf OnSize
}, so if you override this
413 event handler, make sure you deal with the client window.
415 You do not have to manage the size and position of MDI child windows, since they are managed
416 automatically by the client window.
420 \helpref{wxMDIParentFrame::GetToolBar
}{wxmdiparentframegettoolbar
},
\rtfsp
421 \helpref{wxMDIParentFrame::SetToolBar
}{wxmdiparentframesettoolbar
},
\rtfsp
422 \helpref{wxWindow
}{wxwindowonsize
},
\rtfsp
423 \helpref{wxMDIClientWindow
}{wxmdiclientwindow
}
425 \membersection{wxMDIParentFrame::GetActiveChild
}\label{wxmdiparentframegetactivechild
}
427 \constfunc{wxMDIChildFrame*
}{GetActiveChild
}{\void}
429 Returns a pointer to the active MDI child, if there is one.
431 \membersection{wxMDIParentFrame::GetClientWindow
}\label{wxmdiparentframegetclientwindow
}
433 \constfunc{wxMDIClientWindow*
}{GetClientWindow
}{\void}
435 Returns a pointer to the client window.
439 \helpref{wxMDIParentFrame::OnCreateClient
}{wxmdiparentframeoncreateclient
}
441 \membersection{wxMDIParentFrame::GetToolBar
}\label{wxmdiparentframegettoolbar
}
443 \constfunc{virtual wxWindow*
}{GetToolBar
}{\void}
445 Returns the window being used as the toolbar for this frame.
449 \helpref{wxMDIParentFrame::SetToolBar
}{wxmdiparentframesettoolbar
}
451 \membersection{wxMDIParentFrame::OnCreateClient
}\label{wxmdiparentframeoncreateclient
}
453 \func{virtual wxMDIClientWindow*
}{OnCreateClient
}{\void}
455 Override this to return a different kind of client window.
459 You might wish to derive from
\helpref{wxMDIClientWindow
}{wxmdiclientwindow
} in order
460 to implement different erase behaviour, for example, such as painting a bitmap
463 Note that it is probably impossible to have a client window that scrolls as well as painting
464 a bitmap or pattern, since in
{\bf OnScroll
}, the scrollbar positions always return zero.
465 (Solutions to:
\verb$julian.smart@ukonline.co.uk$).
469 \helpref{wxMDIParentFrame::GetClientWindow
}{wxmdiparentframegetclientwindow
},
\rtfsp
470 \helpref{wxMDIClientWindow
}{wxmdiclientwindow
}
472 \membersection{wxMDIParentFrame::SetToolBar
}\label{wxmdiparentframesettoolbar
}
474 \func{virtual void
}{SetToolBar
}{\param{wxWindow*
}{ toolbar
}}
476 Sets the window to be used as a toolbar for this
477 MDI parent window. It saves the application having to manage the positioning
478 of the toolbar MDI client window.
480 \wxheading{Parameters
}
482 \docparam{toolbar
}{Toolbar to manage.
}
486 When the frame is resized, the toolbar is resized to be the width of
487 the frame client area, and the toolbar height is kept the same.
489 The parent of the toolbar must be this frame.
491 If you wish to manage your own toolbar (or perhaps you have more than one),
492 don't call this function, and instead manage your subwindows and the MDI client window by
493 providing an
{\bf OnSize
} event handler. Call
\helpref{wxMDIParentFrame::GetClientSize
}{wxmdiparentframegetclientsize
} to
494 find how much space there is for your windows.
496 Note that SDI (normal) frames and MDI child windows must always have their
497 toolbars managed by the application.
501 \helpref{wxMDIParentFrame::GetToolBar
}{wxmdiparentframegettoolbar
},
\rtfsp
502 \helpref{wxMDIParentFrame::GetClientSize
}{wxmdiparentframegetclientsize
}
504 \membersection{wxMDIParentFrame::Tile
}\label{wxmdiparentframetile
}
506 \func{void
}{Tile
}{\void}
508 Tiles the MDI child windows.
512 \helpref{wxMDIParentFrame::Cascade
}{wxmdiparentframecascade
},
\rtfsp
513 \helpref{wxMDIParentFrame::ArrangeIcons
}{wxmdiparentframearrangeicons
}