]> git.saurik.com Git - wxWidgets.git/blame - docs/latex/wx/docprfrm.tex
* Stream doc.
[wxWidgets.git] / docs / latex / wx / docprfrm.tex
CommitLineData
a660d684
KB
1\section{\class{wxDocParentFrame}}\label{wxdocparentframe}
2
3The wxDocParentFrame class provides a default top-level frame for
4applications using the document/view framework. This class can only be used for SDI (not MDI) parent frames.
5
6It cooperates with the \helpref{wxView}{wxview}, \helpref{wxDocument}{wxdocument},
7\rtfsp\helpref{wxDocManager}{wxdocmanager} and \helpref{wxDocTemplates}{wxdoctemplate} classes.
8
9See the example application in {\tt samples/docview}.
10
11\wxheading{Derived from}
12
13\helpref{wxFrame}{wxframe}\\
14\helpref{wxWindow}{wxwindow}\\
15\helpref{wxEvtHandler}{wxevthandler}\\
16\helpref{wxObject}{wxobject}
17
18\wxheading{See also}
19
20\helpref{Document/view overview}{docviewoverview}, \helpref{wxFrame}{wxframe}
21
22\latexignore{\rtfignore{\wxheading{Members}}}
23
24\membersection{wxDocParentFrame::wxDocParentFrame}
25
82540ef2
JS
26\func{}{wxDocParentFrame}{\param{wxDocManager*}{ manager}, \param{wxFrame *}{parent}, \param{wxWindowID}{ id},
27 \param{const wxString\& }{title}, \param{const wxPoint\&}{ pos = wxDefaultPosition},
28 \param{const wxSize\&}{ size = wxDefaultSize},
29 \param{long}{ style = wxDEFAULT\_FRAME\_STYLE}, \param{const wxString\& }{name = "frame"}}
a660d684
KB
30
31Constructor.
32
33\membersection{wxDocParentFrame::\destruct{wxDocParentFrame}}
34
35\func{}{\destruct{wxDocParentFrame}}{\void}
36
37Destructor.
38
82540ef2 39\membersection{wxDocParentFrame::OnCloseWindow}
a660d684 40
82540ef2 41\func{void}{OnCloseWindow}{\param{wxCloseEvent\&}{ event}}
a660d684
KB
42
43Deletes all views and documents. If no user input cancelled the
82540ef2 44operation, the frame will be destroyed and the application will exit.
a660d684
KB
45
46Since understanding how document/view clean-up takes place can be difficult,
47the implementation of this function is shown below.
48
49\begin{verbatim}
82540ef2 50void wxDocParentFrame::OnCloseWindow(wxCloseEvent& event)
a660d684 51{
82540ef2 52 if (m_docManager->Clear(!event.CanVeto()))
a660d684 53 {
82540ef2 54 this->Destroy();
a660d684 55 }
82540ef2
JS
56 else
57 event.Veto();
a660d684
KB
58}
59\end{verbatim}
60