1998-05-20 10:25:30 -04:00
|
|
|
\section{\class{wxDocParentFrame}}\label{wxdocparentframe}
|
|
|
|
|
|
|
|
The wxDocParentFrame class provides a default top-level frame for
|
|
|
|
applications using the document/view framework. This class can only be used for SDI (not 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{wxFrame}{wxframe}\\
|
|
|
|
\helpref{wxWindow}{wxwindow}\\
|
|
|
|
\helpref{wxEvtHandler}{wxevthandler}\\
|
|
|
|
\helpref{wxObject}{wxobject}
|
|
|
|
|
1999-02-15 15:41:29 -05:00
|
|
|
\wxheading{Include files}
|
|
|
|
|
|
|
|
<wx/docview.h>
|
|
|
|
|
1998-05-20 10:25:30 -04:00
|
|
|
\wxheading{See also}
|
|
|
|
|
|
|
|
\helpref{Document/view overview}{docviewoverview}, \helpref{wxFrame}{wxframe}
|
|
|
|
|
|
|
|
\latexignore{\rtfignore{\wxheading{Members}}}
|
|
|
|
|
2004-09-30 07:15:59 -04:00
|
|
|
\membersection{wxDocParentFrame::wxDocParentFrame}\label{wxdocparentframector}
|
1998-05-20 10:25:30 -04:00
|
|
|
|
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-05-20 10:25:30 -04:00
|
|
|
|
|
|
|
Constructor.
|
|
|
|
|
2004-09-30 07:15:59 -04:00
|
|
|
\membersection{wxDocParentFrame::\destruct{wxDocParentFrame}}\label{wxdocparentframedtor}
|
1998-05-20 10:25:30 -04:00
|
|
|
|
|
|
|
\func{}{\destruct{wxDocParentFrame}}{\void}
|
|
|
|
|
|
|
|
Destructor.
|
|
|
|
|
2004-09-30 07:15:59 -04:00
|
|
|
\membersection{wxDocParentFrame::OnCloseWindow}\label{wxdocparentframeonclosewindow}
|
1998-05-20 10:25:30 -04:00
|
|
|
|
1999-01-29 12:22:47 -05:00
|
|
|
\func{void}{OnCloseWindow}{\param{wxCloseEvent\&}{ event}}
|
1998-05-20 10:25:30 -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-05-20 10:25:30 -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-05-20 10:25:30 -04:00
|
|
|
{
|
1999-01-29 12:22:47 -05:00
|
|
|
if (m_docManager->Clear(!event.CanVeto()))
|
1998-05-20 10:25:30 -04:00
|
|
|
{
|
1999-01-29 12:22:47 -05:00
|
|
|
this->Destroy();
|
1998-05-20 10:25:30 -04:00
|
|
|
}
|
1999-01-29 12:22:47 -05:00
|
|
|
else
|
|
|
|
event.Veto();
|
1998-05-20 10:25:30 -04:00
|
|
|
}
|
|
|
|
\end{verbatim}
|
|
|
|
|