]> git.saurik.com Git - wxWidgets.git/blame - docs/latex/wx/docprfrm.tex
documentation for window ids allocation and wxIdManager (patch 1870570)
[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}\\
7376079d 14\helpref{wxTopLevelWindow}{wxtoplevelwindow}\\
a660d684
KB
15\helpref{wxWindow}{wxwindow}\\
16\helpref{wxEvtHandler}{wxevthandler}\\
17\helpref{wxObject}{wxobject}
18
954b8ae6
JS
19\wxheading{Include files}
20
21<wx/docview.h>
22
a7af285d
VZ
23\wxheading{Library}
24
25\helpref{wxCore}{librarieslist}
26
a660d684
KB
27\wxheading{See also}
28
29\helpref{Document/view overview}{docviewoverview}, \helpref{wxFrame}{wxframe}
30
31\latexignore{\rtfignore{\wxheading{Members}}}
32
b236c10f 33\membersection{wxDocParentFrame::wxDocParentFrame}\label{wxdocparentframector}
a660d684 34
0c246b3c
PC
35\func{}{wxDocParentFrame}{\void}
36
37Default constructor.
38
82540ef2
JS
39\func{}{wxDocParentFrame}{\param{wxDocManager*}{ manager}, \param{wxFrame *}{parent}, \param{wxWindowID}{ id},
40 \param{const wxString\& }{title}, \param{const wxPoint\&}{ pos = wxDefaultPosition},
41 \param{const wxSize\&}{ size = wxDefaultSize},
42 \param{long}{ style = wxDEFAULT\_FRAME\_STYLE}, \param{const wxString\& }{name = "frame"}}
a660d684
KB
43
44Constructor.
45
b236c10f 46\membersection{wxDocParentFrame::\destruct{wxDocParentFrame}}\label{wxdocparentframedtor}
a660d684
KB
47
48\func{}{\destruct{wxDocParentFrame}}{\void}
49
50Destructor.
51
0c246b3c
PC
52\membersection{wxDocParentFrame::Create}\label{wxdocparentframecreate}
53
54\func{bool}{Create}{\param{wxDocManager*}{ manager}, \param{wxFrame *}{parent}, \param{wxWindowID}{ id},
55 \param{const wxString\& }{title}, \param{const wxPoint\&}{ pos = wxDefaultPosition},
56 \param{const wxSize\&}{ size = wxDefaultSize},
57 \param{long}{ style = wxDEFAULT\_FRAME\_STYLE}, \param{const wxString\& }{name = "frame"}}
58
59Used in two-step construction.
60
b1c08dbd
VZ
61\membersection{wxDocParentFrame::GetDocumentManager}\label{wxdocparentframegetdocumentmanager}
62
63\constfunc{wxDocManager *}{GetDocumentManager}{\void}
64
65Returns the associated \helpref{document manager object}{wxdocmanager}.
66
67
68
b236c10f 69\membersection{wxDocParentFrame::OnCloseWindow}\label{wxdocparentframeonclosewindow}
a660d684 70
82540ef2 71\func{void}{OnCloseWindow}{\param{wxCloseEvent\&}{ event}}
a660d684
KB
72
73Deletes all views and documents. If no user input cancelled the
82540ef2 74operation, the frame will be destroyed and the application will exit.
a660d684
KB
75
76Since understanding how document/view clean-up takes place can be difficult,
77the implementation of this function is shown below.
78
79\begin{verbatim}
82540ef2 80void wxDocParentFrame::OnCloseWindow(wxCloseEvent& event)
a660d684 81{
82540ef2 82 if (m_docManager->Clear(!event.CanVeto()))
a660d684 83 {
82540ef2 84 this->Destroy();
a660d684 85 }
82540ef2
JS
86 else
87 event.Veto();
a660d684
KB
88}
89\end{verbatim}
90