]> git.saurik.com Git - wxWidgets.git/blobdiff - docs/latex/wx/docprfrm.tex
no changes, just come cleanup and more comments
[wxWidgets.git] / docs / latex / wx / docprfrm.tex
index 75ae9c7692e9288327aa57413101d75fbb9e286a..aeae63bb6faa2aac11a4a11c9b5aa5d8c0857946 100644 (file)
@@ -11,68 +11,80 @@ See the example application in {\tt samples/docview}.
 \wxheading{Derived from}
 
 \helpref{wxFrame}{wxframe}\\
+\helpref{wxTopLevelWindow}{wxtoplevelwindow}\\
 \helpref{wxWindow}{wxwindow}\\
 \helpref{wxEvtHandler}{wxevthandler}\\
 \helpref{wxObject}{wxobject}
 
+\wxheading{Include files}
+
+<wx/docview.h>
+
+\wxheading{Library}
+
+\helpref{wxCore}{librarieslist}
+
 \wxheading{See also}
 
 \helpref{Document/view overview}{docviewoverview}, \helpref{wxFrame}{wxframe}
 
 \latexignore{\rtfignore{\wxheading{Members}}}
 
-\membersection{wxDocParentFrame::wxDocParentFrame}
+\membersection{wxDocParentFrame::wxDocParentFrame}\label{wxdocparentframector}
+
+\func{}{wxDocParentFrame}{\void}
 
-\func{}{wxDocParentFrame}{\param{wxFrame *}{parent},
- \param{const wxString\& }{title}, \param{int}{ x}, \param{int}{ y}, \param{int}{ width}, \param{int}{ height},
- \param{long}{ style}, \param{const wxString\& }{name}}
+Default constructor.
+
+\func{}{wxDocParentFrame}{\param{wxDocManager*}{ manager}, \param{wxFrame *}{parent}, \param{wxWindowID}{ id},
+ \param{const wxString\& }{title}, \param{const wxPoint\&}{ pos = wxDefaultPosition},
+ \param{const wxSize\&}{ size = wxDefaultSize},
+ \param{long}{ style = wxDEFAULT\_FRAME\_STYLE}, \param{const wxString\& }{name = "frame"}}
 
 Constructor.
 
-\membersection{wxDocParentFrame::\destruct{wxDocParentFrame}}
+\membersection{wxDocParentFrame::\destruct{wxDocParentFrame}}\label{wxdocparentframedtor}
 
 \func{}{\destruct{wxDocParentFrame}}{\void}
 
 Destructor.
 
-\membersection{wxDocParentFrame::OnClose}
+\membersection{wxDocParentFrame::Create}\label{wxdocparentframecreate}
+
+\func{bool}{Create}{\param{wxDocManager*}{ manager}, \param{wxFrame *}{parent}, \param{wxWindowID}{ id},
+ \param{const wxString\& }{title}, \param{const wxPoint\&}{ pos = wxDefaultPosition},
+ \param{const wxSize\&}{ size = wxDefaultSize},
+ \param{long}{ style = wxDEFAULT\_FRAME\_STYLE}, \param{const wxString\& }{name = "frame"}}
+
+Used in two-step construction.
+
+\membersection{wxDocParentFrame::GetDocumentManager}\label{wxdocparentframegetdocumentmanager}
+
+\constfunc{wxDocManager *}{GetDocumentManager}{\void}
 
-\func{bool}{OnClose}{\void}
+Returns the associated \helpref{document manager object}{wxdocmanager}.
+
+
+
+\membersection{wxDocParentFrame::OnCloseWindow}\label{wxdocparentframeonclosewindow}
+
+\func{void}{OnCloseWindow}{\param{wxCloseEvent\&}{ event}}
 
 Deletes all views and documents. If no user input cancelled the
-operation, the function returns TRUE and the application will exit.
+operation, the frame will be destroyed and the application will exit.
 
 Since understanding how document/view clean-up takes place can be difficult,
 the implementation of this function is shown below.
 
 \begin{verbatim}
-bool wxDocParentFrame::OnClose(void)
+void wxDocParentFrame::OnCloseWindow(wxCloseEvent& event)
 {
-  // Delete all views and documents
-  wxNode *node = docManager->GetDocuments().First();
-  while (node)
+  if (m_docManager->Clear(!event.CanVeto()))
   {
-    wxDocument *doc = (wxDocument *)node->Data();
-    wxNode *next = node->Next();
-
-    if (!doc->Close())
-      return FALSE;
-
-    // Implicitly deletes the document when the last
-    // view is removed (deleted)
-    doc->DeleteAllViews();
-
-    // Check document is deleted
-    if (docManager->GetDocuments().Member(doc))
-      delete doc;
-
-    // This assumes that documents are not connected in
-    // any way, i.e. deleting one document does NOT
-    // delete another.
-    node = next;
+    this->Destroy();
   }
-  return TRUE;
+  else
+    event.Veto();
 }
 \end{verbatim}
 
-