Added wxView::OnClosingDocument so the application can do

cleanup.


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@16149 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Julian Smart
2002-07-12 16:08:03 +00:00
parent 904ccf5237
commit b23e843b99
4 changed files with 28 additions and 0 deletions

View File

@@ -164,6 +164,8 @@ bool wxDocument::Close()
bool wxDocument::OnCloseDocument()
{
// Tell all views that we're about to close
NotifyClosing();
DeleteContents();
Modify(FALSE);
return TRUE;
@@ -508,6 +510,17 @@ void wxDocument::UpdateAllViews(wxView *sender, wxObject *hint)
}
}
void wxDocument::NotifyClosing()
{
wxNode *node = m_documentViews.First();
while (node)
{
wxView *view = (wxView *)node->Data();
view->OnClosingDocument();
node = node->Next();
}
}
void wxDocument::SetFilename(const wxString& filename, bool notifyViews)
{
m_documentFile = filename;