]> git.saurik.com Git - wxWidgets.git/blob - docs/latex/wx/docprfrm.tex
Added GetTempDir
[wxWidgets.git] / docs / latex / wx / docprfrm.tex
1 \section{\class{wxDocParentFrame}}\label{wxdocparentframe}
2
3 The wxDocParentFrame class provides a default top-level frame for
4 applications using the document/view framework. This class can only be used for SDI (not MDI) parent frames.
5
6 It cooperates with the \helpref{wxView}{wxview}, \helpref{wxDocument}{wxdocument},
7 \rtfsp\helpref{wxDocManager}{wxdocmanager} and \helpref{wxDocTemplates}{wxdoctemplate} classes.
8
9 See 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{Include files}
19
20 <wx/docview.h>
21
22 \wxheading{See also}
23
24 \helpref{Document/view overview}{docviewoverview}, \helpref{wxFrame}{wxframe}
25
26 \latexignore{\rtfignore{\wxheading{Members}}}
27
28 \membersection{wxDocParentFrame::wxDocParentFrame}\label{wxdocparentframector}
29
30 \func{}{wxDocParentFrame}{\void}
31
32 Default constructor.
33
34 \func{}{wxDocParentFrame}{\param{wxDocManager*}{ manager}, \param{wxFrame *}{parent}, \param{wxWindowID}{ id},
35 \param{const wxString\& }{title}, \param{const wxPoint\&}{ pos = wxDefaultPosition},
36 \param{const wxSize\&}{ size = wxDefaultSize},
37 \param{long}{ style = wxDEFAULT\_FRAME\_STYLE}, \param{const wxString\& }{name = "frame"}}
38
39 Constructor.
40
41 \membersection{wxDocParentFrame::\destruct{wxDocParentFrame}}\label{wxdocparentframedtor}
42
43 \func{}{\destruct{wxDocParentFrame}}{\void}
44
45 Destructor.
46
47 \membersection{wxDocParentFrame::Create}\label{wxdocparentframecreate}
48
49 \func{bool}{Create}{\param{wxDocManager*}{ manager}, \param{wxFrame *}{parent}, \param{wxWindowID}{ id},
50 \param{const wxString\& }{title}, \param{const wxPoint\&}{ pos = wxDefaultPosition},
51 \param{const wxSize\&}{ size = wxDefaultSize},
52 \param{long}{ style = wxDEFAULT\_FRAME\_STYLE}, \param{const wxString\& }{name = "frame"}}
53
54 Used in two-step construction.
55
56 \membersection{wxDocParentFrame::OnCloseWindow}\label{wxdocparentframeonclosewindow}
57
58 \func{void}{OnCloseWindow}{\param{wxCloseEvent\&}{ event}}
59
60 Deletes all views and documents. If no user input cancelled the
61 operation, the frame will be destroyed and the application will exit.
62
63 Since understanding how document/view clean-up takes place can be difficult,
64 the implementation of this function is shown below.
65
66 \begin{verbatim}
67 void wxDocParentFrame::OnCloseWindow(wxCloseEvent& event)
68 {
69 if (m_docManager->Clear(!event.CanVeto()))
70 {
71 this->Destroy();
72 }
73 else
74 event.Veto();
75 }
76 \end{verbatim}
77