1998-05-20 14:25:30 +00: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 20:41:29 +00:00
|
|
|
\wxheading{Include files}
|
|
|
|
|
|
|
|
<wx/docview.h>
|
|
|
|
|
1998-05-20 14:25:30 +00:00
|
|
|
\wxheading{See also}
|
|
|
|
|
|
|
|
\helpref{Document/view overview}{docviewoverview}, \helpref{wxFrame}{wxframe}
|
|
|
|
|
|
|
|
\latexignore{\rtfignore{\wxheading{Members}}}
|
|
|
|
|
|
|
|
\membersection{wxDocParentFrame::wxDocParentFrame}
|
|
|
|
|
1999-01-29 17:22:47 +00: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 14:25:30 +00:00
|
|
|
|
|
|
|
Constructor.
|
|
|
|
|
|
|
|
\membersection{wxDocParentFrame::\destruct{wxDocParentFrame}}
|
|
|
|
|
|
|
|
\func{}{\destruct{wxDocParentFrame}}{\void}
|
|
|
|
|
|
|
|
Destructor.
|
|
|
|
|
1999-01-29 17:22:47 +00:00
|
|
|
\membersection{wxDocParentFrame::OnCloseWindow}
|
1998-05-20 14:25:30 +00:00
|
|
|
|
1999-01-29 17:22:47 +00:00
|
|
|
\func{void}{OnCloseWindow}{\param{wxCloseEvent\&}{ event}}
|
1998-05-20 14:25:30 +00:00
|
|
|
|
|
|
|
Deletes all views and documents. If no user input cancelled the
|
1999-01-29 17:22:47 +00:00
|
|
|
operation, the frame will be destroyed and the application will exit.
|
1998-05-20 14:25:30 +00: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 17:22:47 +00:00
|
|
|
void wxDocParentFrame::OnCloseWindow(wxCloseEvent& event)
|
1998-05-20 14:25:30 +00:00
|
|
|
{
|
1999-01-29 17:22:47 +00:00
|
|
|
if (m_docManager->Clear(!event.CanVeto()))
|
1998-05-20 14:25:30 +00:00
|
|
|
{
|
1999-01-29 17:22:47 +00:00
|
|
|
this->Destroy();
|
1998-05-20 14:25:30 +00:00
|
|
|
}
|
1999-01-29 17:22:47 +00:00
|
|
|
else
|
|
|
|
event.Veto();
|
1998-05-20 14:25:30 +00:00
|
|
|
}
|
|
|
|
\end{verbatim}
|
|
|
|
|