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.
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)
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);
// 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 );