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{Include files
}
17 \wxheading{Window styles
}
20 \begin{twocollist
}\itemsep=
0pt
21 \twocolitem{\windowstyle{wxCAPTION
}}{Puts a caption on the frame.
}
22 \twocolitem{\windowstyle{wxDEFAULT
\_FRAME\_STYLE}}{Defined as
{\bf wxMINIMIZE
\_BOX \pipe wxMAXIMIZE
\_BOX \pipe wxTHICK
\_FRAME \pipe wxSYSTEM
\_MENU \pipe wxCAPTION
}.
}
23 \twocolitem{\windowstyle{wxICONIZE
}}{Display the frame iconized (minimized) (Windows only).
}
24 \twocolitem{\windowstyle{wxMAXIMIZE
}}{Displays the frame maximized (Windows only).
}
25 \twocolitem{\windowstyle{wxMAXIMIZE
\_BOX}}{Displays a maximize box on the frame (Windows and Motif only).
}
26 \twocolitem{\windowstyle{wxMINIMIZE
}}{Identical to
{\bf wxICONIZE
}.
}
27 \twocolitem{\windowstyle{wxMINIMIZE
\_BOX}}{Displays a minimize box on the frame (Windows and Motif only).
}
28 \twocolitem{\windowstyle{wxRESIZE
\_BORDER}}{Displays a resizeable border around the window (Motif only;
29 for Windows, it is implicit in wxTHICK
\_FRAME).
}
30 \twocolitem{\windowstyle{wxSTAY
\_ON\_TOP}}{Stay on top of other windows (Windows only).
}
31 \twocolitem{\windowstyle{wxSYSTEM
\_MENU}}{Displays a system menu (Windows and Motif only).
}
32 \twocolitem{\windowstyle{wxTHICK
\_FRAME}}{Displays a thick frame around the window (Windows and Motif only).
}
35 See also
\helpref{window styles overview
}{windowstyles
}.
39 Although internally an MDI child frame is a child of the MDI client window, in wxWindows
40 you create it as a child of
\helpref{wxMDIParentFrame
}{wxmdiparentframe
}. You can usually
41 forget that the client window exists.
43 MDI child frames are clipped to the area of the MDI client window, and may be iconized
46 You can associate a menubar with a child frame as usual, although an MDI child doesn't display
47 its menubar under its own title bar. The MDI parent frame's menubar will be changed to
48 reflect the currently active child frame. If there are currently no children, the parent
49 frame's own menubar will be displayed.
53 \helpref{wxMDIClientWindow
}{wxmdiclientwindow
},
\helpref{wxMDIParentFrame
}{wxmdiparentframe
},
\rtfsp
54 \helpref{wxFrame
}{wxframe
}
56 \latexignore{\rtfignore{\wxheading{Members
}}}
58 \membersection{wxMDIChildFrame::wxMDIChildFrame
}\label{wxmdichildframeconstr
}
60 \func{}{wxMDIChildFrame
}{\void}
64 \func{}{wxMDIChildFrame
}{\param{wxMDIParentFrame*
}{parent
},
\param{wxWindowID
}{id
},
\rtfsp
65 \param{const wxString\&
}{title
},
\param{const wxPoint\&
}{ pos = wxDefaultPosition
},
\rtfsp
66 \param{const wxSize\&
}{ size = wxDefaultSize
},
\param{long
}{ style = wxDEFAULT
\_FRAME\_STYLE},
\rtfsp
67 \param{const wxString\&
}{name = ``frame"
}}
69 Constructor, creating the window.
71 \wxheading{Parameters
}
73 \docparam{parent
}{The window parent. This should not be NULL.
}
75 \docparam{id
}{The window identifier. It may take a value of -
1 to indicate a default value.
}
77 \docparam{title
}{The caption to be displayed on the frame's title bar.
}
79 \docparam{pos
}{The window position. A value of (-
1, -
1) indicates a default position, chosen by
80 either the windowing system or wxWindows, depending on platform.
}
82 \docparam{size
}{The window size. A value of (-
1, -
1) indicates a default size, chosen by
83 either the windowing system or wxWindows, depending on platform.
}
85 \docparam{style
}{The window style. See
\helpref{wxMDIChildFrame
}{wxmdichildframe
}.
}
87 \docparam{name
}{The name of the window. This parameter is used to associate a name with the item,
88 allowing the application user to set Motif resource values for
97 \helpref{wxMDIChildFrame::Create
}{wxmdichildframecreate
}
99 \membersection{wxMDIChildFrame::
\destruct{wxMDIChildFrame
}}
101 \func{}{\destruct{wxMDIChildFrame
}}{\void}
103 Destructor. Destroys all child windows and menu bar if present.
105 \membersection{wxMDIChildFrame::Activate
}\label{wxmdichildframeactivate
}
107 \func{void
}{Activate
}{\void}
109 Activates this MDI child frame.
113 \helpref{wxMDIChildFrame::Maximize
}{wxmdichildframemaximize
},
\rtfsp
114 \helpref{wxMDIChildFrame::Restore
}{wxmdichildframerestore
}
116 \membersection{wxMDIChildFrame::Create
}\label{wxmdichildframecreate
}
118 \func{bool
}{Create
}{\param{wxWindow*
}{parent
},
\param{wxWindowID
}{id
},
\rtfsp
119 \param{const wxString\&
}{title
},
\param{const wxPoint\&
}{ pos = wxDefaultPosition
},
\rtfsp
120 \param{const wxSize\&
}{ size = wxDefaultSize
},
\param{long
}{ style = wxDEFAULT
\_FRAME\_STYLE},
\rtfsp
121 \param{const wxString\&
}{name = ``frame"
}}
123 Used in two-step frame construction. See
\helpref{wxMDIChildFrame::wxMDIChildFrame
}{wxmdichildframeconstr
}\rtfsp
126 \membersection{wxMDIChildFrame::Maximize
}\label{wxmdichildframemaximize
}
128 \func{void
}{Maximize
}{\void}
130 Maximizes this MDI child frame.
134 \helpref{wxMDIChildFrame::Activate
}{wxmdichildframeactivate
},
\rtfsp
135 \helpref{wxMDIChildFrame::Restore
}{wxmdichildframerestore
}
137 \membersection{wxMDIChildFrame::Restore
}\label{wxmdichildframerestore
}
139 \func{void
}{Restore
}{\void}
141 Restores this MDI child frame (unmaximizes).
145 \helpref{wxMDIChildFrame::Activate
}{wxmdichildframeactivate
},
\rtfsp
146 \helpref{wxMDIChildFrame::Maximize
}{wxmdichildframemaximize
}
149 \section{\class{wxMDIClientWindow
}}\label{wxmdiclientwindow
}
151 An MDI client window is a child of
\helpref{wxMDIParentFrame
}{wxmdiparentframe
}, and manages zero or
152 more
\helpref{wxMDIChildFrame
}{wxmdichildframe
} objects.
154 \wxheading{Derived from
}
156 \helpref{wxWindow
}{wxwindow
}\\
157 \helpref{wxEvtHandler
}{wxevthandler
}\\
158 \helpref{wxObject
}{wxobject
}
160 \wxheading{Include files
}
166 The client window is the area where MDI child windows exist. It doesn't have to cover the whole
167 parent frame; other windows such as toolbars and a help window might coexist with it.
168 There can be scrollbars on a client window, which are controlled by the parent window style.
170 The
{\bf wxMDIClientWindow
} class is usually adequate without further derivation, and it is created
171 automatically when the MDI parent frame is created. If the application needs to derive a new class,
172 the function
\helpref{wxMDIParentFrame::OnCreateClient
}{wxmdiparentframeoncreateclient
} must be
173 overridden in order to give an opportunity to use a different class of client window.
175 Under Windows
95, the client window will automatically have a sunken border style when
176 the active child is not maximized, and no border style when a child is maximized.
180 \helpref{wxMDIChildFrame
}{wxmdichildframe
},
\helpref{wxMDIParentFrame
}{wxmdiparentframe
},
\rtfsp
181 \helpref{wxFrame
}{wxframe
}
183 \latexignore{\rtfignore{\wxheading{Members
}}}
185 \membersection{wxMDIClientWindow::wxMDIClientWindow
}\label{wxmdiclientwindowconstr
}
187 \func{}{wxMDIClientWindow
}{\void}
191 \func{}{wxMDIClientWindow
}{\param{wxMDIParentFrame*
}{parent
},
\param{long
}{ style =
0}}
193 Constructor, creating the window.
195 \wxheading{Parameters
}
197 \docparam{parent
}{The window parent.
}
199 \docparam{style
}{The window style. Currently unused.
}
203 The second style of constructor is called within
\helpref{wxMDIParentFrame::OnCreateClient
}{wxmdiparentframeoncreateclient
}.
207 \helpref{wxMDIParentFrame::wxMDIParentFrame
}{wxmdiparentframeconstr
},
\rtfsp
208 \helpref{wxMDIParentFrame::OnCreateClient
}{wxmdiparentframeoncreateclient
}
210 \membersection{wxMDIClientWindow::
\destruct{wxMDIClientWindow
}}
212 \func{}{\destruct{wxMDIClientWindow
}}{\void}
216 \membersection{wxMDIClientWindow::CreateClient
}\label{wxmdiclientwindowcreateclient
}
218 \func{bool
}{CreateClient
}{\param{wxMDIParentFrame*
}{parent
},
\param{long
}{ style =
0}}
220 Used in two-step frame construction. See
\helpref{wxMDIClientWindow::wxMDIClientWindow
}{wxmdiclientwindowconstr
}\rtfsp
223 \section{\class{wxMDIParentFrame
}}\label{wxmdiparentframe
}
225 An MDI (Multiple Document Interface) parent frame is a window which can contain
226 MDI child frames in its own `desktop'. It is a convenient way to avoid window clutter,
227 and is used in many popular Windows applications, such as Microsoft Word(TM).
229 \wxheading{Derived from
}
231 \helpref{wxFrame
}{wxframe
}\\
232 \helpref{wxWindow
}{wxwindow
}\\
233 \helpref{wxEvtHandler
}{wxevthandler
}\\
234 \helpref{wxObject
}{wxobject
}
236 \wxheading{Include files
}
242 There may be multiple MDI parent frames in a single application, but this probably only makes sense
243 within programming development environments.
245 Child frames may be either
\helpref{wxMDIChildFrame
}{wxmdichildframe
}, or
\helpref{wxFrame
}{wxframe
}.
247 An MDI parent frame always has a
\helpref{wxMDIClientWindow
}{wxmdiclientwindow
} associated with it, which
248 is the parent for MDI client frames.
249 This client window may be resized to accomodate non-MDI windows, as seen in Microsoft Visual C++ (TM) and
250 Microsoft Publisher (TM), where a documentation window is placed to one side of the workspace.
252 MDI remains popular despite dire warnings from Microsoft itself that MDI is an obsolete
253 user interface style.
255 The implementation is native in Windows, and simulated under Motif. Under Motif,
256 the child window frames will often have a different appearance from other frames
257 because the window decorations are simulated.
259 \wxheading{Window styles
}
262 \begin{twocollist
}\itemsep=
0pt
263 \twocolitem{\windowstyle{wxCAPTION
}}{Puts a caption on the frame.
}
264 \twocolitem{\windowstyle{wxDEFAULT
\_FRAME\_STYLE}}{Defined as
{\bf wxMINIMIZE
\_BOX \pipe wxMAXIMIZE
\_BOX \pipe wxTHICK
\_FRAME \pipe wxSYSTEM
\_MENU \pipe wxCAPTION
}.
}
265 \twocolitem{\windowstyle{wxHSCROLL
}}{Displays a horizontal scrollbar in the
{\it client window
}, allowing
266 the user to view child frames that are off the current view.
}
267 \twocolitem{\windowstyle{wxICONIZE
}}{Display the frame iconized (minimized) (Windows only).
}
268 \twocolitem{\windowstyle{wxMAXIMIZE
}}{Displays the frame maximized (Windows only).
}
269 \twocolitem{\windowstyle{wxMAXIMIZE
\_BOX}}{Displays a maximize box on the frame (Windows and Motif only).
}
270 \twocolitem{\windowstyle{wxMINIMIZE
}}{Identical to
{\bf wxICONIZE
}.
}
271 \twocolitem{\windowstyle{wxMINIMIZE
\_BOX}}{Displays a minimize box on the frame (Windows and Motif only).
}
272 \twocolitem{\windowstyle{wxRESIZE
\_BORDER}}{Displays a resizeable border around the window (Motif only;
273 for Windows, it is implicit in wxTHICK
\_FRAME).
}
274 \twocolitem{\windowstyle{wxSTAY
\_ON\_TOP}}{Stay on top of other windows (Windows only).
}
275 \twocolitem{\windowstyle{wxSYSTEM
\_MENU}}{Displays a system menu (Windows and Motif only).
}
276 \twocolitem{\windowstyle{wxTHICK
\_FRAME}}{Displays a thick frame around the window (Windows and Motif only).
}
277 \twocolitem{\windowstyle{wxVSCROLL
}}{Displays a vertical scrollbar in the
{\it client window
}, allowing
278 the user to view child frames that are off the current view.
}
281 See also
\helpref{window styles overview
}{windowstyles
}.
285 \helpref{wxMDIChildFrame
}{wxmdichildframe
},
\helpref{wxMDIClientWindow
}{wxmdiclientwindow
},
\rtfsp
286 \helpref{wxFrame
}{wxframe
},
\helpref{wxDialog
}{wxdialog
}
288 \latexignore{\rtfignore{\wxheading{Members
}}}
290 \membersection{wxMDIParentFrame::wxMDIParentFrame
}\label{wxmdiparentframeconstr
}
292 \func{}{wxMDIParentFrame
}{\void}
296 \func{}{wxMDIParentFrame
}{\param{wxWindow*
}{parent
},
\param{wxWindowID
}{id
},
\rtfsp
297 \param{const wxString\&
}{title
},
\param{const wxPoint\&
}{ pos = wxDefaultPosition
},
\rtfsp
298 \param{const wxSize\&
}{ size = wxDefaultSize
},
\param{long
}{ style = wxDEFAULT
\_FRAME\_STYLE \pipe wxVSCROLL
\pipe wxHSCROLL
},
\rtfsp
299 \param{const wxString\&
}{name = ``frame"
}}
301 Constructor, creating the window.
303 \wxheading{Parameters
}
305 \docparam{parent
}{The window parent. This should be NULL.
}
307 \docparam{id
}{The window identifier. It may take a value of -
1 to indicate a default value.
}
309 \docparam{title
}{The caption to be displayed on the frame's title bar.
}
311 \docparam{pos
}{The window position. A value of (-
1, -
1) indicates a default position, chosen by
312 either the windowing system or wxWindows, depending on platform.
}
314 \docparam{size
}{The window size. A value of (-
1, -
1) indicates a default size, chosen by
315 either the windowing system or wxWindows, depending on platform.
}
317 \docparam{style
}{The window style. See
\helpref{wxMDIParentFrame
}{wxmdiparentframe
}.
}
319 \docparam{name
}{The name of the window. This parameter is used to associate a name with the item,
320 allowing the application user to set Motif resource values for
325 During the construction of the frame, the client window will be created. To use a different class
326 from
\helpref{wxMDIClientWindow
}{wxmdiclientwindow
}, override
\rtfsp
327 \helpref{wxMDIParentFrame::OnCreateClient
}{wxmdiparentframeoncreateclient
}.
329 Under Windows
95, the client window will automatically have a sunken border style when
330 the active child is not maximized, and no border style when a child is maximized.
334 \helpref{wxMDIParentFrame::Create
}{wxmdiparentframecreate
},
\rtfsp
335 \helpref{wxMDIParentFrame::OnCreateClient
}{wxmdiparentframeoncreateclient
}
337 \membersection{wxMDIParentFrame::
\destruct{wxMDIParentFrame
}}
339 \func{}{\destruct{wxMDIParentFrame
}}{\void}
341 Destructor. Destroys all child windows and menu bar if present.
343 \membersection{wxMDIParentFrame::ActivateNext
}\label{wxmdiparentframeactivatenext
}
345 \func{void
}{ActivateNext
}{\void}
347 Activates the MDI child following the currently active one.
351 \helpref{wxMDIParentFrame::ActivatePrevious
}{wxmdiparentframeactivateprevious
}
353 \membersection{wxMDIParentFrame::ActivatePrevious
}\label{wxmdiparentframeactivateprevious
}
355 \func{void
}{ActivatePrevious
}{\void}
357 Activates the MDI child preceding the currently active one.
361 \helpref{wxMDIParentFrame::ActivateNext
}{wxmdiparentframeactivatenext
}
364 \membersection{wxMDIParentFrame::ArrangeIcons
}\label{wxmdiparentframearrangeicons
}
366 \func{void
}{ArrangeIcons
}{\void}
368 Arranges any iconized (minimized) MDI child windows.
372 \helpref{wxMDIParentFrame::Cascade
}{wxmdiparentframecascade
},
\rtfsp
373 \helpref{wxMDIParentFrame::Tile
}{wxmdiparentframetile
}
375 \membersection{wxMDIParentFrame::Cascade
}\label{wxmdiparentframecascade
}
377 \func{void
}{Cascade
}{\void}
379 Arranges the MDI child windows in a cascade.
383 \helpref{wxMDIParentFrame::Tile
}{wxmdiparentframetile
},
\rtfsp
384 \helpref{wxMDIParentFrame::ArrangeIcons
}{wxmdiparentframearrangeicons
}
386 \membersection{wxMDIParentFrame::Create
}\label{wxmdiparentframecreate
}
388 \func{bool
}{Create
}{\param{wxWindow*
}{parent
},
\param{wxWindowID
}{id
},
\rtfsp
389 \param{const wxString\&
}{title
},
\param{const wxPoint\&
}{ pos = wxDefaultPosition
},
\rtfsp
390 \param{const wxSize\&
}{ size = wxDefaultSize
},
\param{long
}{ style = wxDEFAULT
\_FRAME\_STYLE \pipe wxVSCROLL
\pipe wxHSCROLL
},
\rtfsp
391 \param{const wxString\&
}{name = ``frame"
}}
393 Used in two-step frame construction. See
\helpref{wxMDIParentFrame::wxMDIParentFrame
}{wxmdiparentframeconstr
}\rtfsp
396 \membersection{wxMDIParentFrame::GetClientSize
}\label{wxmdiparentframegetclientsize
}
398 \constfunc{virtual void
}{GetClientSize
}{\param{int*
}{width
},
\param{int*
}{height
}}
400 This gets the size of the frame `client area' in pixels.
402 \wxheading{Parameters
}
404 \docparam{width
}{Receives the client width in pixels.
}
406 \docparam{height
}{Receives the client height in pixels.
}
410 The client area is the area which may be drawn on by the programmer, excluding title bar, border, status bar,
411 and toolbar if present.
413 If you wish to manage your own toolbar (or perhaps you have more than one),
414 provide an
{\bf OnSize
} event handler. Call
{\bf GetClientSize
} to
415 find how much space there is for your windows and don't forget to set the size and position
416 of the MDI client window as well as your toolbar and other windows (but not the status bar).
418 If you have set a toolbar with
\helpref{wxMDIParentFrame::SetToolbar
}{wxmdiparentframesettoolbar
},
419 the client size returned will have subtracted the toolbar height. However, the available positions
420 for the client window and other windows of the frame do not start at zero - you must add the toolbar height.
422 The position and size of the status bar and toolbar (if known to the frame) are always managed
423 by
{\bf wxMDIParentFrame
}, regardless of what behaviour is defined in your
{\bf OnSize
} event handler.
424 However, the client window position and size are always set in
{\bf OnSize
}, so if you override this
425 event handler, make sure you deal with the client window.
427 You do not have to manage the size and position of MDI child windows, since they are managed
428 automatically by the client window.
432 \helpref{wxMDIParentFrame::GetToolBar
}{wxmdiparentframegettoolbar
},
\rtfsp
433 \helpref{wxMDIParentFrame::SetToolBar
}{wxmdiparentframesettoolbar
},
\rtfsp
434 \helpref{wxWindow
}{wxwindowonsize
},
\rtfsp
435 \helpref{wxMDIClientWindow
}{wxmdiclientwindow
}
437 \membersection{wxMDIParentFrame::GetActiveChild
}\label{wxmdiparentframegetactivechild
}
439 \constfunc{wxMDIChildFrame*
}{GetActiveChild
}{\void}
441 Returns a pointer to the active MDI child, if there is one.
443 \membersection{wxMDIParentFrame::GetClientWindow
}\label{wxmdiparentframegetclientwindow
}
445 \constfunc{wxMDIClientWindow*
}{GetClientWindow
}{\void}
447 Returns a pointer to the client window.
451 \helpref{wxMDIParentFrame::OnCreateClient
}{wxmdiparentframeoncreateclient
}
453 \membersection{wxMDIParentFrame::GetToolBar
}\label{wxmdiparentframegettoolbar
}
455 \constfunc{virtual wxWindow*
}{GetToolBar
}{\void}
457 Returns the window being used as the toolbar for this frame.
461 \helpref{wxMDIParentFrame::SetToolBar
}{wxmdiparentframesettoolbar
}
463 \membersection{wxMDIParentFrame::OnCreateClient
}\label{wxmdiparentframeoncreateclient
}
465 \func{virtual wxMDIClientWindow*
}{OnCreateClient
}{\void}
467 Override this to return a different kind of client window.
471 You might wish to derive from
\helpref{wxMDIClientWindow
}{wxmdiclientwindow
} in order
472 to implement different erase behaviour, for example, such as painting a bitmap
475 Note that it is probably impossible to have a client window that scrolls as well as painting
476 a bitmap or pattern, since in
{\bf OnScroll
}, the scrollbar positions always return zero.
477 (Solutions to:
\verb$julian.smart@ukonline.co.uk$).
481 \helpref{wxMDIParentFrame::GetClientWindow
}{wxmdiparentframegetclientwindow
},
\rtfsp
482 \helpref{wxMDIClientWindow
}{wxmdiclientwindow
}
484 \membersection{wxMDIParentFrame::SetToolBar
}\label{wxmdiparentframesettoolbar
}
486 \func{virtual void
}{SetToolBar
}{\param{wxWindow*
}{ toolbar
}}
488 Sets the window to be used as a toolbar for this
489 MDI parent window. It saves the application having to manage the positioning
490 of the toolbar MDI client window.
492 \wxheading{Parameters
}
494 \docparam{toolbar
}{Toolbar to manage.
}
498 When the frame is resized, the toolbar is resized to be the width of
499 the frame client area, and the toolbar height is kept the same.
501 The parent of the toolbar must be this frame.
503 If you wish to manage your own toolbar (or perhaps you have more than one),
504 don't call this function, and instead manage your subwindows and the MDI client window by
505 providing an
{\bf OnSize
} event handler. Call
\helpref{wxMDIParentFrame::GetClientSize
}{wxmdiparentframegetclientsize
} to
506 find how much space there is for your windows.
508 Note that SDI (normal) frames and MDI child windows must always have their
509 toolbars managed by the application.
513 \helpref{wxMDIParentFrame::GetToolBar
}{wxmdiparentframegettoolbar
},
\rtfsp
514 \helpref{wxMDIParentFrame::GetClientSize
}{wxmdiparentframegetclientsize
}
516 \membersection{wxMDIParentFrame::Tile
}\label{wxmdiparentframetile
}
518 \func{void
}{Tile
}{\void}
520 Tiles the MDI child windows.
524 \helpref{wxMDIParentFrame::Cascade
}{wxmdiparentframecascade
},
\rtfsp
525 \helpref{wxMDIParentFrame::ArrangeIcons
}{wxmdiparentframearrangeicons
}