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:
@@ -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;
|
||||
|
Reference in New Issue
Block a user