1 \section{\class{wxDocMDIParentFrame
}}\label{wxdocmdiparentframe
}
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.
6 It cooperates with the
\helpref{wxView
}{wxview
},
\helpref{wxDocument
}{wxdocument
},
7 \rtfsp\helpref{wxDocManager
}{wxdocmanager
} and
\helpref{wxDocTemplates
}{wxdoctemplate
} classes.
9 See the example application in
{\tt samples/docview
}.
11 \wxheading{Derived from
}
13 \helpref{wxMDIParentFrame
}{wxmdiparentframe
}\\
14 \helpref{wxFrame
}{wxframe
}\\
15 \helpref{wxWindow
}{wxwindow
}\\
16 \helpref{wxEvtHandler
}{wxevthandler
}\\
17 \helpref{wxObject
}{wxobject
}
21 \helpref{Document/view overview
}{docviewoverview
},
\helpref{wxMDIParentFrame
}{wxmdiparentframe
}
23 \latexignore{\rtfignore{\wxheading{Members
}}}
25 \membersection{wxDocMDIParentFrame::wxDocMDIParentFrame
}
27 \func{}{wxDocMDIParentFrame
}{\param{wxFrame *
}{parent
},
\param{wxWindowID
}{ id
},
28 \param{const wxString\&
}{title
},
\param{int
}{ x
},
\param{int
}{ y
},
\param{int
}{ width
},
\param{int
}{ height
},
29 \param{long
}{ style
},
\param{const wxString\&
}{name
}}
33 \membersection{wxDocMDIParentFrame::
\destruct{wxDocMDIParentFrame
}}
35 \func{}{\destruct{wxDocMDIParentFrame
}}{\void}
39 \membersection{wxDocMDIParentFrame::OnClose
}
41 \func{bool
}{OnClose
}{\void}
43 Deletes all views and documents. If no user input cancelled the
44 operation, the function returns TRUE and the application will exit.
46 Since understanding how
document/view clean-up takes place can be difficult,
47 the implementation of this function is shown below.
50 bool wxDocMDIParentFrame::OnClose(void)
52 // Delete all views and documents
53 wxNode *node = docManager->GetDocuments().First();
56 wxDocument *doc = (wxDocument *)node->Data();
57 wxNode *next = node->Next();
62 // Implicitly deletes the
document when the last
63 // view is removed (deleted)
64 doc->DeleteAllViews();
66 // Check
document is deleted
67 if (docManager->GetDocuments().Member(doc))
70 // This assumes that documents are not connected in
71 // any way, i.e. deleting one
document does NOT