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}}}
|
|
|
|
|
2004-09-30 07:15:59 -04:00
|
|
|
\membersection{wxDocMDIParentFrame::wxDocMDIParentFrame}\label{wxdocmdiparentframector}
|
1998-07-29 02:51:33 -04:00
|
|
|
|
2006-01-21 12:49:48 -05:00
|
|
|
\func{}{wxDocMDIParentFrame}{\void}
|
|
|
|
|
2005-02-19 19:07:35 -05:00
|
|
|
\func{}{wxDocMDIParentFrame}{\param{wxDocManager*}{ manager}, \param{wxFrame *}{parent}, \param{wxWindowID}{ id},
|
1999-01-29 12:22:47 -05:00
|
|
|
\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.
|
|
|
|
|
2004-09-30 07:15:59 -04:00
|
|
|
\membersection{wxDocMDIParentFrame::\destruct{wxDocMDIParentFrame}}\label{wxdocmdiparentframedtor}
|
1998-07-29 02:51:33 -04:00
|
|
|
|
|
|
|
\func{}{\destruct{wxDocMDIParentFrame}}{\void}
|
|
|
|
|
|
|
|
Destructor.
|
|
|
|
|
2006-01-21 12:49:48 -05:00
|
|
|
\membersection{wxDocMDIParentFrame::Create}\label{wxdocmdiparentframecreate}
|
|
|
|
|
|
|
|
\func{bool}{Create}{\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"}}
|
|
|
|
|
|
|
|
Creates the window.
|
|
|
|
|
2004-09-30 07:15:59 -04:00
|
|
|
\membersection{wxDocMDIParentFrame::OnCloseWindow}\label{wxdocmdiparentframeonclosewindow}
|
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}
|
|
|
|
|