diff --git a/docs/latex/wx/docmanag.tex b/docs/latex/wx/docmanag.tex index d8516852f0..6e53df45bc 100644 --- a/docs/latex/wx/docmanag.tex +++ b/docs/latex/wx/docmanag.tex @@ -324,14 +324,31 @@ construct wxDocManager with no arguments. \func{bool}{MakeDefaultName}{\param{const wxString\& }{buf}} -Copies a suitable default name into {\it buf}. This is implemented by -appending an integer counter to the string {\bf unnamed} and incrementing -the counter. +This method is preserved for backwards compatibility in wxWidgets 2.8 but is +renamed to \helpref{MakeNewDocumentName}{wxdocmanagermakenewdocumentname} in +wxWidgets 3.0, please see its description for the details. + +This function simply copies the value returned by MakeNewDocumentName() into +the provided \arg{buf} and returns \true. \perlnote{In wxPerl this function must return the modified name rather than just modifying the argument.} +\membersection{wxDocManager::MakeNewDocumentName}\label{wxdocmanagermakenewdocumentname} + +\func{wxString}{MakeNewDocumentName}{\void} + +Returns the name to be used for a new document. The default implementation +appends an integer counter to the string {\bf unnamed} and increments the +counter. To customize this behaviour, you need to override the virtual +\helpref{MakeNewDocumentName}{wxdocmanagermakedefaultname} method but if you +only need to call this method, an not to override it, please use this method +which is forward-compatible with wxWidgets 3.0. + +\wxsince{2.8.8} + + \membersection{wxDocManager::OnCreateFileHistory}\label{wxdocmanageroncreatefilehistory} \func{wxFileHistory *}{OnCreateFileHistory}{\void} diff --git a/include/wx/docview.h b/include/wx/docview.h index 51369d0388..f9b6436ad5 100644 --- a/include/wx/docview.h +++ b/include/wx/docview.h @@ -408,8 +408,22 @@ public: wxList& GetTemplates() { return m_templates; } // Make a default document name + // + // NB: this method is renamed to MakeNewDocumentName() in wx 3.0, you still + // need to override it if your code needs to customize the default name + // generation but if you just use it from your code, prefer the version + // below which is forward-compatible with wx 3.0 virtual bool MakeDefaultName(wxString& buf); +#if wxABI_VERSION >= 20808 + wxString MakeNewDocumentName() const + { + wxString s; + MakeDefaultName(s); + return s; + } +#endif // wx ABI >= 2.8.8 + // Make a frame title (override this to do something different) virtual wxString MakeFrameTitle(wxDocument* doc); diff --git a/version-script.in b/version-script.in index f0d1f38339..36d064c8d5 100644 --- a/version-script.in +++ b/version-script.in @@ -30,7 +30,8 @@ *wxApp*MacHideApp*; *TimeZone*Make*; *wxBitmapButton*OnFocusChange*; - *wxGridBagSizer*AdjustForOverflow*; + *wxDocManager*MakeNewDocumentName*; + *wxGridBagSizer*AdjustForOverflow*; *wxRemotelyScrolledTreeCtrl*DoCalcScrolledPosition*; *wxRemotelyScrolledTreeCtrl*SetScrollbar*; *wxRenderer_Draw*;