]>
Commit | Line | Data |
---|---|---|
f7bd2698 JS |
1 | \section{\class{wxDocMDIParentFrame}}\label{wxdocmdiparentframe} |
2 | ||
3 | The wxDocMDIParentFrame class provides a default top-level frame for | |
4 | applications using the document/view framework. This class can only be used for 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{wxMDIParentFrame}{wxmdiparentframe}\\ | |
14 | \helpref{wxFrame}{wxframe}\\ | |
15 | \helpref{wxWindow}{wxwindow}\\ | |
16 | \helpref{wxEvtHandler}{wxevthandler}\\ | |
17 | \helpref{wxObject}{wxobject} | |
18 | ||
954b8ae6 JS |
19 | \wxheading{Include files} |
20 | ||
21 | <wx/docmdi.h> | |
22 | ||
f7bd2698 JS |
23 | \wxheading{See also} |
24 | ||
25 | \helpref{Document/view overview}{docviewoverview}, \helpref{wxMDIParentFrame}{wxmdiparentframe} | |
26 | ||
27 | \latexignore{\rtfignore{\wxheading{Members}}} | |
28 | ||
b236c10f | 29 | \membersection{wxDocMDIParentFrame::wxDocMDIParentFrame}\label{wxdocmdiparentframector} |
f7bd2698 | 30 | |
82540ef2 JS |
31 | \func{}{wxDocParentFrame}{\param{wxDocManager*}{ manager}, \param{wxFrame *}{parent}, \param{wxWindowID}{ id}, |
32 | \param{const wxString\& }{title}, \param{const wxPoint\&}{ pos = wxDefaultPosition}, | |
33 | \param{const wxSize\&}{ size = wxDefaultSize}, | |
34 | \param{long}{ style = wxDEFAULT\_FRAME\_STYLE}, \param{const wxString\& }{name = "frame"}} | |
f7bd2698 JS |
35 | |
36 | Constructor. | |
37 | ||
b236c10f | 38 | \membersection{wxDocMDIParentFrame::\destruct{wxDocMDIParentFrame}}\label{wxdocmdiparentframedtor} |
f7bd2698 JS |
39 | |
40 | \func{}{\destruct{wxDocMDIParentFrame}}{\void} | |
41 | ||
42 | Destructor. | |
43 | ||
b236c10f | 44 | \membersection{wxDocMDIParentFrame::OnCloseWindow}\label{wxdocmdiparentframeonclosewindow} |
f7bd2698 | 45 | |
82540ef2 | 46 | \func{void}{OnCloseWindow}{\param{wxCloseEvent\&}{ event}} |
f7bd2698 JS |
47 | |
48 | Deletes all views and documents. If no user input cancelled the | |
82540ef2 | 49 | operation, the frame will be destroyed and the application will exit. |
f7bd2698 JS |
50 | |
51 | Since understanding how document/view clean-up takes place can be difficult, | |
52 | the implementation of this function is shown below. | |
53 | ||
54 | \begin{verbatim} | |
82540ef2 | 55 | void wxDocParentFrame::OnCloseWindow(wxCloseEvent& event) |
f7bd2698 | 56 | { |
82540ef2 | 57 | if (m_docManager->Clear(!event.CanVeto())) |
f7bd2698 | 58 | { |
82540ef2 | 59 | this->Destroy(); |
f7bd2698 | 60 | } |
82540ef2 JS |
61 | else |
62 | event.Veto(); | |
f7bd2698 JS |
63 | } |
64 | \end{verbatim} | |
65 |