X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/b54129836cbc680fbeb338bb6087c1a4f80bdf18..99c4be680622f58a48a04dfe0835b59d2c41afea:/include/wx/docview.h diff --git a/include/wx/docview.h b/include/wx/docview.h index 49be65f1bb..9ab4bebf46 100644 --- a/include/wx/docview.h +++ b/include/wx/docview.h @@ -73,9 +73,16 @@ public: void SetDocumentName(const wxString& name) { m_documentTypeName = name; } wxString GetDocumentName() const { return m_documentTypeName; } + // access the flag indicating whether this document had been already saved, + // SetDocumentSaved() is only used internally, don't call it bool GetDocumentSaved() const { return m_savedYet; } void SetDocumentSaved(bool saved = true) { m_savedYet = saved; } + // return true if the document hasn't been modified since the last time it + // was saved (implying that it returns false if it was never saved, even if + // the document is not modified) + bool AlreadySaved() const { return !IsModified() && GetDocumentSaved(); } + virtual bool Close(); virtual bool Save(); virtual bool SaveAs(); @@ -100,6 +107,10 @@ public: // modified to false) virtual bool OnSaveModified(); + // if you override, remember to call the default + // implementation (wxDocument::OnChangeFilename) + virtual void OnChangeFilename(bool notifyViews); + // Called by framework if created automatically by the default document // manager: gives document a chance to initialise and (usually) create a // view @@ -425,7 +436,7 @@ public: virtual void FileHistoryAddFilesToMenu(); virtual void FileHistoryAddFilesToMenu(wxMenu* menu); - wxString GetLastDirectory() const { return m_lastDirectory; } + wxString GetLastDirectory() const; void SetLastDirectory(const wxString& dir) { m_lastDirectory = dir; } // Get the current document manager @@ -483,7 +494,7 @@ public: const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long type = wxDEFAULT_FRAME_STYLE, - const wxString& name = wxT("frame")); + const wxString& name = wxFrameNameStr); virtual ~wxDocChildFrame(){} void OnActivate(wxActivateEvent& event);