1 \section{\class{wxDocParentFrame
}}\label{wxdocparentframe
}
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.
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{wxFrame
}{wxframe
}\\
14 \helpref{wxWindow
}{wxwindow
}\\
15 \helpref{wxEvtHandler
}{wxevthandler
}\\
16 \helpref{wxObject
}{wxobject
}
20 \helpref{Document/view overview
}{docviewoverview
},
\helpref{wxFrame
}{wxframe
}
22 \latexignore{\rtfignore{\wxheading{Members
}}}
24 \membersection{wxDocParentFrame::wxDocParentFrame
}
26 \func{}{wxDocParentFrame
}{\param{wxFrame *
}{parent
},
\param{wxWindowID
}{ id
},
27 \param{const wxString\&
}{title
},
\param{int
}{ x
},
\param{int
}{ y
},
\param{int
}{ width
},
\param{int
}{ height
},
28 \param{long
}{ style
},
\param{const wxString\&
}{name
}}
32 \membersection{wxDocParentFrame::
\destruct{wxDocParentFrame
}}
34 \func{}{\destruct{wxDocParentFrame
}}{\void}
38 \membersection{wxDocParentFrame::OnClose
}
40 \func{bool
}{OnClose
}{\void}
42 Deletes all views and documents. If no user input cancelled the
43 operation, the function returns TRUE and the application will exit.
45 Since understanding how
document/view clean-up takes place can be difficult,
46 the implementation of this function is shown below.
49 bool wxDocParentFrame::OnClose(void)
51 // Delete all views and documents
52 wxNode *node = docManager->GetDocuments().First();
55 wxDocument *doc = (wxDocument *)node->Data();
56 wxNode *next = node->Next();
61 // Implicitly deletes the
document when the last
62 // view is removed (deleted)
63 doc->DeleteAllViews();
65 // Check
document is deleted
66 if (docManager->GetDocuments().Member(doc))
69 // This assumes that documents are not connected in
70 // any way, i.e. deleting one
document does NOT