X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/1e6feb95a79834836e88143b15d9f424ebe79621..aa4b7ef978937fe5d93fda9276ecbbee0cd66517:/include/wx/docview.h diff --git a/include/wx/docview.h b/include/wx/docview.h index 994487059a..0fc38cf3d5 100644 --- a/include/wx/docview.h +++ b/include/wx/docview.h @@ -20,6 +20,7 @@ #include "wx/list.h" #include "wx/cmndata.h" #include "wx/string.h" +#include "wx/frame.h" #if wxUSE_PRINTING_ARCHITECTURE #include "wx/print.h" @@ -95,11 +96,6 @@ public: virtual wxInputStream& LoadObject(wxInputStream& stream); #endif -#if wxUSE_SERIAL - // need this to keep from hiding the virtual from wxObject - virtual void LoadObject(wxObjectInputStream& stream) { wxObject::LoadObject(stream); }; -#endif - // Called by wxWindows virtual bool OnSaveDocument(const wxString& filename); virtual bool OnOpenDocument(const wxString& filename); @@ -137,6 +133,7 @@ public: wxView *GetFirstView() const; virtual void UpdateAllViews(wxView *sender = (wxView *) NULL, wxObject *hint = (wxObject *) NULL); + virtual void NotifyClosing(); // Remove all views (because we're closing the document) virtual bool DeleteAllViews(); @@ -175,7 +172,7 @@ public: ~wxView(); wxDocument *GetDocument() const { return m_viewDocument; } - void SetDocument(wxDocument *doc); + virtual void SetDocument(wxDocument *doc); wxString GetViewName() const { return m_viewTypeName; } void SetViewName(const wxString& name) { m_viewTypeName = name; }; @@ -187,6 +184,7 @@ public: virtual void OnDraw(wxDC *dc) = 0; virtual void OnPrint(wxDC *dc, wxObject *info); virtual void OnUpdate(wxView *sender, wxObject *hint = (wxObject *) NULL); + virtual void OnClosingDocument() {}; virtual void OnChangeFilename(); // Called by framework if created automatically by the default document @@ -304,6 +302,7 @@ public: // Handlers for common user commands void OnFileClose(wxCommandEvent& event); + void OnFileCloseAll(wxCommandEvent& event); void OnFileNew(wxCommandEvent& event); void OnFileOpen(wxCommandEvent& event); void OnFileRevert(wxCommandEvent& event); @@ -364,6 +363,9 @@ public: void AddDocument(wxDocument *doc); void RemoveDocument(wxDocument *doc); + // closes all currently open documents + bool CloseDocuments(bool force = TRUE); + // Clear remaining documents and templates bool Clear(bool force = TRUE);