X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/a0219e4580a925de871080b703d14504c96ad3d6..427861bde09badef1a2950ad799e69fac6b4a48a:/interface/wx/docview.h diff --git a/interface/wx/docview.h b/interface/wx/docview.h index 4dd49c4be8..6c294b46ae 100644 --- a/interface/wx/docview.h +++ b/interface/wx/docview.h @@ -43,13 +43,13 @@ public: A name that should be unique for a given view. @param docClassInfo A pointer to the run-time document class information as returned by - the CLASSINFO() macro, e.g. CLASSINFO(MyDocumentClass). If this is + the wxCLASSINFO() macro, e.g. wxCLASSINFO(MyDocumentClass). If this is not supplied, you will need to derive a new wxDocTemplate class and override the CreateDocument() member to return a new document instance on demand. @param viewClassInfo A pointer to the run-time view class information as returned by the - CLASSINFO() macro, e.g. CLASSINFO(MyViewClass). If this is not + wxCLASSINFO() macro, e.g. wxCLASSINFO(MyViewClass). If this is not supplied, you will need to derive a new wxDocTemplate class and override the CreateView() member to return a new view instance on demand. @@ -363,8 +363,27 @@ public: */ void AssociateTemplate(wxDocTemplate* temp); + /** + Closes the specified document. + + If @a force is @true, the document is closed even if it has unsaved + changes. + + @param doc + The document to close, must be non-@NULL. + @param force + If @true, close the document even if wxDocument::Close() returns + @false. + @return + @true if the document was closed or @false if closing it was + cancelled by user (only in @a force = @false case). + */ + bool CloseDocument(wxDocument *doc, bool force = false); + /** Closes all currently opened documents. + + @see CloseDocument() */ bool CloseDocuments(bool force = true); @@ -1141,6 +1160,18 @@ public: */ virtual bool DeleteAllViews(); + /** + Virtual method called from OnCloseDocument(). + + This method may be overridden to perform any additional cleanup which + might be needed when the document is closed. + + The return value of this method is currently ignored. + + The default version does nothing and simply returns @true. + */ + virtual bool DeleteContents(); + /** Returns a pointer to the command processor associated with this document. @@ -1258,10 +1289,10 @@ public: /** This virtual function is called when the document is being closed. - The default implementation calls DeleteContents() (an empty - implementation) and sets the modified flag to @false. You can override - it to supply additional behaviour when the document is closed with - Close(). + The default implementation calls DeleteContents() (which may be + overridden to perform additional cleanup) and sets the modified flag to + @false. You can override it to supply additional behaviour when the + document is closed with Close(). Notice that previous wxWidgets versions used to call this function also from OnNewDocument(), rather counter-intuitively. This is no longer the