for ( it = m_documentViews.begin(), en = m_documentViews.end();
it != en;
- )
+ ++it )
{
wxView *view = (wxView *)*it;
if (!view->Close())
return false;
- wxList::iterator next = it; ++next;
-
delete view; // Deletes node implicitly
- it = next;
}
+
// If we haven't yet deleted the document (for example
// if there were no views) then delete it.
if (manager && manager->GetDocuments().Member(this))
#if wxUSE_PRINTING_ARCHITECTURE
EVT_MENU(wxID_PRINT, wxDocManager::OnPrint)
- EVT_MENU(wxID_PRINT_SETUP, wxDocManager::OnPrintSetup)
EVT_MENU(wxID_PREVIEW, wxDocManager::OnPreview)
EVT_UPDATE_UI(wxID_PRINT, wxDocManager::OnUpdatePrint)
- EVT_UPDATE_UI(wxID_PRINT_SETUP, wxDocManager::OnUpdatePrintSetup)
EVT_UPDATE_UI(wxID_PREVIEW, wxDocManager::OnUpdatePreview)
#endif
END_EVENT_TABLE()
#endif // wxUSE_PRINTING_ARCHITECTURE
}
-void wxDocManager::OnPrintSetup(wxCommandEvent& WXUNUSED(event))
-{
-#if wxUSE_PRINTING_ARCHITECTURE
- wxWindow *parentWin = wxTheApp->GetTopWindow();
- wxView *view = GetCurrentView();
- if (view)
- parentWin = view->GetFrame();
-
- wxPrintDialogData data;
-
- wxPrintDialog printerDialog(parentWin, &data);
- printerDialog.GetPrintDialogData().SetSetupDialog(true);
- printerDialog.ShowModal();
-#endif // wxUSE_PRINTING_ARCHITECTURE
-}
-
void wxDocManager::OnPreview(wxCommandEvent& WXUNUSED(event))
{
#if wxUSE_PRINTING_ARCHITECTURE
event.Enable( (doc != (wxDocument*) NULL) );
}
-void wxDocManager::OnUpdatePrintSetup(wxUpdateUIEvent& event)
-{
- event.Enable( true );
-}
-
void wxDocManager::OnUpdatePreview(wxUpdateUIEvent& event)
{
wxDocument *doc = GetCurrentDocument();
view->SetFrame(this);
}
-wxDocChildFrame::~wxDocChildFrame()
-{
-}
-
// Extend event processing to search the view's event table
bool wxDocChildFrame::ProcessEvent(wxEvent& event)
{