1998-07-29 02:51:33 -04:00
|
|
|
\section{\class{wxDocMDIParentFrame}}\label{wxdocmdiparentframe}
|
|
|
|
|
|
|
|
The wxDocMDIParentFrame class provides a default top-level frame for
|
|
|
|
applications using the document/view framework. This class can only be used for MDI parent frames.
|
|
|
|
|
|
|
|
It cooperates with the \helpref{wxView}{wxview}, \helpref{wxDocument}{wxdocument},
|
|
|
|
\rtfsp\helpref{wxDocManager}{wxdocmanager} and \helpref{wxDocTemplates}{wxdoctemplate} classes.
|
|
|
|
|
|
|
|
See the example application in {\tt samples/docview}.
|
|
|
|
|
|
|
|
\wxheading{Derived from}
|
|
|
|
|
|
|
|
\helpref{wxMDIParentFrame}{wxmdiparentframe}\\
|
|
|
|
\helpref{wxFrame}{wxframe}\\
|
|
|
|
\helpref{wxWindow}{wxwindow}\\
|
|
|
|
\helpref{wxEvtHandler}{wxevthandler}\\
|
|
|
|
\helpref{wxObject}{wxobject}
|
|
|
|
|
1999-02-15 15:41:29 -05:00
|
|
|
\wxheading{Include files}
|
|
|
|
|
|
|
|
<wx/docmdi.h>
|
|
|
|
|
1998-07-29 02:51:33 -04:00
|
|
|
\wxheading{See also}
|
|
|
|
|
|
|
|
\helpref{Document/view overview}{docviewoverview}, \helpref{wxMDIParentFrame}{wxmdiparentframe}
|
|
|
|
|
|
|
|
\latexignore{\rtfignore{\wxheading{Members}}}
|
|
|
|
|
|
|
|
\membersection{wxDocMDIParentFrame::wxDocMDIParentFrame}
|
|
|
|
|
1999-01-29 12:22:47 -05:00
|
|
|
\func{}{wxDocParentFrame}{\param{wxDocManager*}{ manager}, \param{wxFrame *}{parent}, \param{wxWindowID}{ id},
|
|
|
|
\param{const wxString\& }{title}, \param{const wxPoint\&}{ pos = wxDefaultPosition},
|
|
|
|
\param{const wxSize\&}{ size = wxDefaultSize},
|
|
|
|
\param{long}{ style = wxDEFAULT\_FRAME\_STYLE}, \param{const wxString\& }{name = "frame"}}
|
1998-07-29 02:51:33 -04:00
|
|
|
|
|
|
|
Constructor.
|
|
|
|
|
|
|
|
\membersection{wxDocMDIParentFrame::\destruct{wxDocMDIParentFrame}}
|
|
|
|
|
|
|
|
\func{}{\destruct{wxDocMDIParentFrame}}{\void}
|
|
|
|
|
|
|
|
Destructor.
|
|
|
|
|
1999-01-29 12:22:47 -05:00
|
|
|
\membersection{wxDocMDIParentFrame::OnCloseWindow}
|
1998-07-29 02:51:33 -04:00
|
|
|
|
1999-01-29 12:22:47 -05:00
|
|
|
\func{void}{OnCloseWindow}{\param{wxCloseEvent\&}{ event}}
|
1998-07-29 02:51:33 -04:00
|
|
|
|
|
|
|
Deletes all views and documents. If no user input cancelled the
|
1999-01-29 12:22:47 -05:00
|
|
|
operation, the frame will be destroyed and the application will exit.
|
1998-07-29 02:51:33 -04:00
|
|
|
|
|
|
|
Since understanding how document/view clean-up takes place can be difficult,
|
|
|
|
the implementation of this function is shown below.
|
|
|
|
|
|
|
|
\begin{verbatim}
|
1999-01-29 12:22:47 -05:00
|
|
|
void wxDocParentFrame::OnCloseWindow(wxCloseEvent& event)
|
1998-07-29 02:51:33 -04:00
|
|
|
{
|
1999-01-29 12:22:47 -05:00
|
|
|
if (m_docManager->Clear(!event.CanVeto()))
|
1998-07-29 02:51:33 -04:00
|
|
|
{
|
1999-01-29 12:22:47 -05:00
|
|
|
this->Destroy();
|
1998-07-29 02:51:33 -04:00
|
|
|
}
|
1999-01-29 12:22:47 -05:00
|
|
|
else
|
|
|
|
event.Veto();
|
1998-07-29 02:51:33 -04:00
|
|
|
}
|
|
|
|
\end{verbatim}
|
|
|
|
|