1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407
|
<HTML>
<head><title>wxMDIParentFrame</title></head>
<BODY BGCOLOR=#FFFFFF>
<A NAME="wxmdiparentframe"></A><CENTER>
<A HREF="wx.htm"><img align=center src="contents.gif" BORDER=0 ALT="Contents"></A> <A HREF="wx22.htm#classref"><img align=center src="up.gif" BORDER=0 ALT="Up"></A> <A HREF="wx135.htm#wxmdiclientwindow"><img align=center src="back.gif" BORDER=0 ALT="Previous"></A> <A HREF="wx137.htm#wxmemorydc"><img align=center src="forward.gif" BORDER=0 ALT="Next"></A> </CENTER><HR>
<H2>wxMDIParentFrame</H2>
<P>
An MDI (Multiple Document Interface) parent frame is a window which can contain
MDI child frames in its own 'desktop'. It is a convenient way to avoid window clutter,
and is used in many popular Windows applications, such as Microsoft Word(TM).<P>
<B><FONT COLOR="#FF0000">Derived from</FONT></B><P>
<A HREF="wx104.htm#wxframe">wxFrame</A><BR>
<A HREF="wx260.htm#wxwindow">wxWindow</A><BR>
<A HREF="wx85.htm#wxevthandler">wxEvtHandler</A><BR>
<A HREF="wx158.htm#wxobject">wxObject</A><P>
<B><FONT COLOR="#FF0000">Include files</FONT></B><P>
<wx/mdi.h><P>
<B><FONT COLOR="#FF0000">Remarks</FONT></B><P>
There may be multiple MDI parent frames in a single application, but this probably only makes sense
within programming development environments.<P>
Child frames may be either <A HREF="wx134.htm#wxmdichildframe">wxMDIChildFrame</A>, or <A HREF="wx104.htm#wxframe">wxFrame</A>.<P>
An MDI parent frame always has a <A HREF="wx135.htm#wxmdiclientwindow">wxMDIClientWindow</A> associated with it, which
is the parent for MDI client frames.
This client window may be resized to accomodate non-MDI windows, as seen in Microsoft Visual C++ (TM) and
Microsoft Publisher (TM), where a documentation window is placed to one side of the workspace.<P>
MDI remains popular despite dire warnings from Microsoft itself that MDI is an obsolete
user interface style.<P>
The implementation is native in Windows, and simulated under Motif. Under Motif,
the child window frames will often have a different appearance from other frames
because the window decorations are simulated.<P>
<B><FONT COLOR="#FF0000">Window styles</FONT></B><P>
<TABLE>
<TR><TD VALIGN=TOP>
<B>wxCAPTION</B>
</TD>
<TD VALIGN=TOP>
Puts a caption on the frame.
</TD></TR>
<TR><TD VALIGN=TOP>
<B>wxDEFAULT_FRAME_STYLE</B>
</TD>
<TD VALIGN=TOP>
Defined as <B>wxMINIMIZE_BOX | wxMAXIMIZE_BOX | wxTHICK_FRAME | wxSYSTEM_MENU | wxCAPTION</B>.
</TD></TR>
<TR><TD VALIGN=TOP>
<B>wxHSCROLL</B>
</TD>
<TD VALIGN=TOP>
Displays a horizontal scrollbar in the <I>client window</I>, allowing
the user to view child frames that are off the current view.
</TD></TR>
<TR><TD VALIGN=TOP>
<B>wxICONIZE</B>
</TD>
<TD VALIGN=TOP>
Display the frame iconized (minimized) (Windows only).
</TD></TR>
<TR><TD VALIGN=TOP>
<B>wxMAXIMIZE</B>
</TD>
<TD VALIGN=TOP>
Displays the frame maximized (Windows only).
</TD></TR>
<TR><TD VALIGN=TOP>
<B>wxMAXIMIZE_BOX</B>
</TD>
<TD VALIGN=TOP>
Displays a maximize box on the frame (Windows and Motif only).
</TD></TR>
<TR><TD VALIGN=TOP>
<B>wxMINIMIZE</B>
</TD>
<TD VALIGN=TOP>
Identical to <B>wxICONIZE</B>.
</TD></TR>
<TR><TD VALIGN=TOP>
<B>wxMINIMIZE_BOX</B>
</TD>
<TD VALIGN=TOP>
Displays a minimize box on the frame (Windows and Motif only).
</TD></TR>
<TR><TD VALIGN=TOP>
<B>wxRESIZE_BORDER</B>
</TD>
<TD VALIGN=TOP>
Displays a resizeable border around the window (Motif only;
for Windows, it is implicit in wxTHICK_FRAME).
</TD></TR>
<TR><TD VALIGN=TOP>
<B>wxSTAY_ON_TOP</B>
</TD>
<TD VALIGN=TOP>
Stay on top of other windows (Windows only).
</TD></TR>
<TR><TD VALIGN=TOP>
<B>wxSYSTEM_MENU</B>
</TD>
<TD VALIGN=TOP>
Displays a system menu (Windows and Motif only).
</TD></TR>
<TR><TD VALIGN=TOP>
<B>wxTHICK_FRAME</B>
</TD>
<TD VALIGN=TOP>
Displays a thick frame around the window (Windows and Motif only).
</TD></TR>
<TR><TD VALIGN=TOP>
<B>wxVSCROLL</B>
</TD>
<TD VALIGN=TOP>
Displays a vertical scrollbar in the <I>client window</I>, allowing
the user to view child frames that are off the current view.
</TD></TR>
</TABLE>
<P>
See also <A HREF="wx305.htm#windowstyles">window styles overview</A>.<P>
<B><FONT COLOR="#FF0000">See also</FONT></B><P>
<A HREF="wx134.htm#wxmdichildframe">wxMDIChildFrame</A>, <A HREF="wx135.htm#wxmdiclientwindow">wxMDIClientWindow</A>,
<A HREF="wx104.htm#wxframe">wxFrame</A>, <A HREF="wx71.htm#wxdialog">wxDialog</A><P>
<B><FONT COLOR="#FF0000">Members</FONT></B><P>
<A HREF="#wxmdiparentframeconstr">wxMDIParentFrame::wxMDIParentFrame</A><BR>
<A HREF="#topic552">wxMDIParentFrame::~wxMDIParentFrame</A><BR>
<A HREF="#wxmdiparentframeactivatenext">wxMDIParentFrame::ActivateNext</A><BR>
<A HREF="#wxmdiparentframeactivateprevious">wxMDIParentFrame::ActivatePrevious</A><BR>
<A HREF="#wxmdiparentframearrangeicons">wxMDIParentFrame::ArrangeIcons</A><BR>
<A HREF="#wxmdiparentframecascade">wxMDIParentFrame::Cascade</A><BR>
<A HREF="#wxmdiparentframecreate">wxMDIParentFrame::Create</A><BR>
<A HREF="#wxmdiparentframegetclientsize">wxMDIParentFrame::GetClientSize</A><BR>
<A HREF="#wxmdiparentframegetactivechild">wxMDIParentFrame::GetActiveChild</A><BR>
<A HREF="#wxmdiparentframegetclientwindow">wxMDIParentFrame::GetClientWindow</A><BR>
<A HREF="#wxmdiparentframegettoolbar">wxMDIParentFrame::GetToolBar</A><BR>
<A HREF="#wxmdiparentframeoncreateclient">wxMDIParentFrame::OnCreateClient</A><BR>
<A HREF="#wxmdiparentframesettoolbar">wxMDIParentFrame::SetToolBar</A><BR>
<A HREF="#wxmdiparentframetile">wxMDIParentFrame::Tile</A><BR>
<P>
<HR>
<A NAME="wxmdiparentframeconstr"></A>
<H3>wxMDIParentFrame::wxMDIParentFrame</H3>
<P>
<B></B> <B>wxMDIParentFrame</B>()<P>
Default constructor.<P>
<B></B> <B>wxMDIParentFrame</B>(<B>wxWindow* </B><I>parent</I>, <B>wxWindowID </B><I>id</I>,
<B>const wxString& </B><I>title</I>, <B>const wxPoint&</B><I> pos = wxDefaultPosition</I>,
<B>const wxSize&</B><I> size = wxDefaultSize</I>, <B>long</B><I> style = wxDEFAULT_FRAME_STYLE | wxVSCROLL | wxHSCROLL</I>,
<B>const wxString& </B><I>name = "frame"</I>)<P>
Constructor, creating the window.<P>
<B><FONT COLOR="#FF0000">Parameters</FONT></B><P>
<I>parent</I><UL><UL>
The window parent. This should be NULL.</UL></UL>
<P>
<I>id</I><UL><UL>
The window identifier. It may take a value of -1 to indicate a default value.</UL></UL>
<P>
<I>title</I><UL><UL>
The caption to be displayed on the frame's title bar.</UL></UL>
<P>
<I>pos</I><UL><UL>
The window position. A value of (-1, -1) indicates a default position, chosen by
either the windowing system or wxWindows, depending on platform.</UL></UL>
<P>
<I>size</I><UL><UL>
The window size. A value of (-1, -1) indicates a default size, chosen by
either the windowing system or wxWindows, depending on platform.</UL></UL>
<P>
<I>style</I><UL><UL>
The window style. See <A HREF="wx136.htm#wxmdiparentframe">wxMDIParentFrame</A>.</UL></UL>
<P>
<I>name</I><UL><UL>
The name of the window. This parameter is used to associate a name with the item,
allowing the application user to set Motif resource values for
individual windows.</UL></UL>
<P>
<B><FONT COLOR="#FF0000">Remarks</FONT></B><P>
During the construction of the frame, the client window will be created. To use a different class
from <A HREF="wx135.htm#wxmdiclientwindow">wxMDIClientWindow</A>, override
<A HREF="wx136.htm#wxmdiparentframeoncreateclient">wxMDIParentFrame::OnCreateClient</A>.<P>
Under Windows 95, the client window will automatically have a sunken border style when
the active child is not maximized, and no border style when a child is maximized.<P>
<B><FONT COLOR="#FF0000">See also</FONT></B><P>
<A HREF="wx136.htm#wxmdiparentframecreate">wxMDIParentFrame::Create</A>,
<A HREF="wx136.htm#wxmdiparentframeoncreateclient">wxMDIParentFrame::OnCreateClient</A><P>
<HR>
<A NAME="topic552"></A>
<H3>wxMDIParentFrame::~wxMDIParentFrame</H3>
<P>
<B></B> <B>~wxMDIParentFrame</B>()<P>
Destructor. Destroys all child windows and menu bar if present.<P>
<HR>
<A NAME="wxmdiparentframeactivatenext"></A>
<H3>wxMDIParentFrame::ActivateNext</H3>
<P>
<B>void</B> <B>ActivateNext</B>()<P>
Activates the MDI child following the currently active one.<P>
<B><FONT COLOR="#FF0000">See also</FONT></B><P>
<A HREF="wx136.htm#wxmdiparentframeactivateprevious">wxMDIParentFrame::ActivatePrevious</A><P>
<HR>
<A NAME="wxmdiparentframeactivateprevious"></A>
<H3>wxMDIParentFrame::ActivatePrevious</H3>
<P>
<B>void</B> <B>ActivatePrevious</B>()<P>
Activates the MDI child preceding the currently active one.<P>
<B><FONT COLOR="#FF0000">See also</FONT></B><P>
<A HREF="wx136.htm#wxmdiparentframeactivatenext">wxMDIParentFrame::ActivateNext</A><P>
<HR>
<A NAME="wxmdiparentframearrangeicons"></A>
<H3>wxMDIParentFrame::ArrangeIcons</H3>
<P>
<B>void</B> <B>ArrangeIcons</B>()<P>
Arranges any iconized (minimized) MDI child windows.<P>
<B><FONT COLOR="#FF0000">See also</FONT></B><P>
<A HREF="wx136.htm#wxmdiparentframecascade">wxMDIParentFrame::Cascade</A>,
<A HREF="wx136.htm#wxmdiparentframetile">wxMDIParentFrame::Tile</A><P>
<HR>
<A NAME="wxmdiparentframecascade"></A>
<H3>wxMDIParentFrame::Cascade</H3>
<P>
<B>void</B> <B>Cascade</B>()<P>
Arranges the MDI child windows in a cascade.<P>
<B><FONT COLOR="#FF0000">See also</FONT></B><P>
<A HREF="wx136.htm#wxmdiparentframetile">wxMDIParentFrame::Tile</A>,
<A HREF="wx136.htm#wxmdiparentframearrangeicons">wxMDIParentFrame::ArrangeIcons</A><P>
<HR>
<A NAME="wxmdiparentframecreate"></A>
<H3>wxMDIParentFrame::Create</H3>
<P>
<B>bool</B> <B>Create</B>(<B>wxWindow* </B><I>parent</I>, <B>wxWindowID </B><I>id</I>,
<B>const wxString& </B><I>title</I>, <B>const wxPoint&</B><I> pos = wxDefaultPosition</I>,
<B>const wxSize&</B><I> size = wxDefaultSize</I>, <B>long</B><I> style = wxDEFAULT_FRAME_STYLE | wxVSCROLL | wxHSCROLL</I>,
<B>const wxString& </B><I>name = "frame"</I>)<P>
Used in two-step frame construction. See <A HREF="wx136.htm#wxmdiparentframeconstr">wxMDIParentFrame::wxMDIParentFrame</A>
for further details.<P>
<HR>
<A NAME="wxmdiparentframegetclientsize"></A>
<H3>wxMDIParentFrame::GetClientSize</H3>
<P>
<B>virtual void</B> <B>GetClientSize</B>(<B>int* </B><I>width</I>, <B>int* </B><I>height</I>) <B>const</B><P>
This gets the size of the frame 'client area' in pixels.<P>
<B><FONT COLOR="#FF0000">Parameters</FONT></B><P>
<I>width</I><UL><UL>
Receives the client width in pixels.</UL></UL>
<P>
<I>height</I><UL><UL>
Receives the client height in pixels.</UL></UL>
<P>
<B><FONT COLOR="#FF0000">Remarks</FONT></B><P>
The client area is the area which may be drawn on by the programmer, excluding title bar, border, status bar,
and toolbar if present.<P>
If you wish to manage your own toolbar (or perhaps you have more than one),
provide an <B>OnSize</B> event handler. Call <B>GetClientSize</B> to
find how much space there is for your windows and don't forget to set the size and position
of the MDI client window as well as your toolbar and other windows (but not the status bar).<P>
If you have set a toolbar with <A HREF="wx136.htm#wxmdiparentframesettoolbar">wxMDIParentFrame::SetToolbar</A>,
the client size returned will have subtracted the toolbar height. However, the available positions
for the client window and other windows of the frame do not start at zero - you must add the toolbar height.<P>
The position and size of the status bar and toolbar (if known to the frame) are always managed
by <B>wxMDIParentFrame</B>, regardless of what behaviour is defined in your <B>OnSize</B> event handler.
However, the client window position and size are always set in <B>OnSize</B>, so if you override this
event handler, make sure you deal with the client window.<P>
You do not have to manage the size and position of MDI child windows, since they are managed
automatically by the client window.<P>
<B><FONT COLOR="#FF0000">See also</FONT></B><P>
<A HREF="wx136.htm#wxmdiparentframegettoolbar">wxMDIParentFrame::GetToolBar</A>,
<A HREF="wx136.htm#wxmdiparentframesettoolbar">wxMDIParentFrame::SetToolBar</A>,
<A HREF="wx260.htm#wxwindowonsize">wxWindow</A>,
<A HREF="wx135.htm#wxmdiclientwindow">wxMDIClientWindow</A><P>
<B><FONT COLOR="#0000C8">wxPython note:</FONT></B><BR>
The wxPython version of this method takes no arguments and
returns a tuple containing width and height.<P>
<HR>
<A NAME="wxmdiparentframegetactivechild"></A>
<H3>wxMDIParentFrame::GetActiveChild</H3>
<P>
<B>wxMDIChildFrame*</B> <B>GetActiveChild</B>() <B>const</B><P>
Returns a pointer to the active MDI child, if there is one.<P>
<HR>
<A NAME="wxmdiparentframegetclientwindow"></A>
<H3>wxMDIParentFrame::GetClientWindow</H3>
<P>
<B>wxMDIClientWindow*</B> <B>GetClientWindow</B>() <B>const</B><P>
Returns a pointer to the client window.<P>
<B><FONT COLOR="#FF0000">See also</FONT></B><P>
<A HREF="wx136.htm#wxmdiparentframeoncreateclient">wxMDIParentFrame::OnCreateClient</A><P>
<HR>
<A NAME="wxmdiparentframegettoolbar"></A>
<H3>wxMDIParentFrame::GetToolBar</H3>
<P>
<B>virtual wxWindow*</B> <B>GetToolBar</B>() <B>const</B><P>
Returns the window being used as the toolbar for this frame.<P>
<B><FONT COLOR="#FF0000">See also</FONT></B><P>
<A HREF="wx136.htm#wxmdiparentframesettoolbar">wxMDIParentFrame::SetToolBar</A><P>
<HR>
<A NAME="wxmdiparentframeoncreateclient"></A>
<H3>wxMDIParentFrame::OnCreateClient</H3>
<P>
<B>virtual wxMDIClientWindow*</B> <B>OnCreateClient</B>()<P>
Override this to return a different kind of client window.<P>
<B><FONT COLOR="#FF0000">Remarks</FONT></B><P>
You might wish to derive from <A HREF="wx135.htm#wxmdiclientwindow">wxMDIClientWindow</A> in order
to implement different erase behaviour, for example, such as painting a bitmap
on the background.<P>
Note that it is probably impossible to have a client window that scrolls as well as painting
a bitmap or pattern, since in <B>OnScroll</B>, the scrollbar positions always return zero.
(Solutions to: <TT>julian.smart@ukonline.co.uk</TT>).<P>
<B><FONT COLOR="#FF0000">See also</FONT></B><P>
<A HREF="wx136.htm#wxmdiparentframegetclientwindow">wxMDIParentFrame::GetClientWindow</A>,
<A HREF="wx135.htm#wxmdiclientwindow">wxMDIClientWindow</A><P>
<HR>
<A NAME="wxmdiparentframesettoolbar"></A>
<H3>wxMDIParentFrame::SetToolBar</H3>
<P>
<B>virtual void</B> <B>SetToolBar</B>(<B>wxWindow*</B><I> toolbar</I>)<P>
Sets the window to be used as a toolbar for this
MDI parent window. It saves the application having to manage the positioning
of the toolbar MDI client window.<P>
<B><FONT COLOR="#FF0000">Parameters</FONT></B><P>
<I>toolbar</I><UL><UL>
Toolbar to manage.</UL></UL>
<P>
<B><FONT COLOR="#FF0000">Remarks</FONT></B><P>
When the frame is resized, the toolbar is resized to be the width of
the frame client area, and the toolbar height is kept the same.<P>
The parent of the toolbar must be this frame.<P>
If you wish to manage your own toolbar (or perhaps you have more than one),
don't call this function, and instead manage your subwindows and the MDI client window by
providing an <B>OnSize</B> event handler. Call <A HREF="wx136.htm#wxmdiparentframegetclientsize">wxMDIParentFrame::GetClientSize</A> to
find how much space there is for your windows.<P>
Note that SDI (normal) frames and MDI child windows must always have their
toolbars managed by the application.<P>
<B><FONT COLOR="#FF0000">See also</FONT></B><P>
<A HREF="wx136.htm#wxmdiparentframegettoolbar">wxMDIParentFrame::GetToolBar</A>,
<A HREF="wx136.htm#wxmdiparentframegetclientsize">wxMDIParentFrame::GetClientSize</A><P>
<HR>
<A NAME="wxmdiparentframetile"></A>
<H3>wxMDIParentFrame::Tile</H3>
<P>
<B>void</B> <B>Tile</B>()<P>
Tiles the MDI child windows.<P>
<B><FONT COLOR="#FF0000">See also</FONT></B><P>
<A HREF="wx136.htm#wxmdiparentframecascade">wxMDIParentFrame::Cascade</A>,
<A HREF="wx136.htm#wxmdiparentframearrangeicons">wxMDIParentFrame::ArrangeIcons</A><P>
</BODY></HTML>
|