replace wxDocument::GetPrintableName(wxString&) and wxDocManager::MakeDefaultName(wxString&) with GetUserReadableName() and MakeNewDocumentName() which return wxStrings directly

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@46488 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2007-06-16 12:49:56 +00:00
parent 6ae3ead6f0
commit 724b119a15
5 changed files with 97 additions and 49 deletions

View File

@@ -140,8 +140,17 @@ public:
virtual wxDocTemplate *GetDocumentTemplate() const { return m_documentTemplate; }
virtual void SetDocumentTemplate(wxDocTemplate *temp) { m_documentTemplate = temp; }
// Get title, or filename if no title, else [unnamed]
virtual bool GetPrintableName(wxString& buf) const;
// Get the document name to be shown to the user: the title if there is
// any, otherwise the filename if the document was saved and, finally,
// "unnamed" otherwise
virtual wxString GetUserReadableName() const;
#if WXWIN_COMPATIBILITY_2_8
// use GetUserReadableName() instead
wxDEPRECATED_BUT_USED_INTERNALLY(
virtual bool GetPrintableName(wxString& buf) const
);
#endif // WXWIN_COMPATIBILITY_2_8
// Returns a window that can be used as a parent for document-related
// dialogs. Override if necessary.
@@ -164,6 +173,9 @@ protected:
virtual bool DoSaveDocument(const wxString& file);
virtual bool DoOpenDocument(const wxString& file);
// the default implementation of GetUserReadableName()
wxString DoGetUserReadableName() const;
private:
DECLARE_ABSTRACT_CLASS(wxDocument)
DECLARE_NO_COPY_CLASS(wxDocument)
@@ -393,8 +405,9 @@ public:
wxList& GetDocuments() { return m_docs; }
wxList& GetTemplates() { return m_templates; }
// Make a default document name
virtual bool MakeDefaultName(wxString& buf);
// Return the default name for a new document (by default returns strings
// in the form "unnamed <counter>" but can be overridden)
virtual wxString MakeNewDocumentName();
// Make a frame title (override this to do something different)
virtual wxString MakeFrameTitle(wxDocument* doc);
@@ -423,6 +436,13 @@ public:
// Get the current document manager
static wxDocManager* GetDocumentManager() { return sm_docManager; }
#if WXWIN_COMPATIBILITY_2_8
// deprecated, override GetDefaultName() instead
wxDEPRECATED_BUT_USED_INTERNALLY(
virtual bool MakeDefaultName(wxString& buf)
);
#endif
#if WXWIN_COMPATIBILITY_2_6
// deprecated, use GetHistoryFilesCount() instead
wxDEPRECATED( size_t GetNoHistoryFiles() const );