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