X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/ac0ac8241f5ea7249ea01c04452efc0b72f49b1f..794bcc2dea743ac907b839f54e451847c9ea4b72:/include/wx/docview.h diff --git a/include/wx/docview.h b/include/wx/docview.h index 39854b9847..592a7439db 100644 --- a/include/wx/docview.h +++ b/include/wx/docview.h @@ -316,6 +316,20 @@ public: void OnUndo(wxCommandEvent& event); void OnRedo(wxCommandEvent& event); + // Handlers for UI update commands + void OnUpdateFileOpen(wxUpdateUIEvent& event); + void OnUpdateFileClose(wxUpdateUIEvent& event); + void OnUpdateFileRevert(wxUpdateUIEvent& event); + void OnUpdateFileNew(wxUpdateUIEvent& event); + void OnUpdateFileSave(wxUpdateUIEvent& event); + void OnUpdateFileSaveAs(wxUpdateUIEvent& event); + void OnUpdateUndo(wxUpdateUIEvent& event); + void OnUpdateRedo(wxUpdateUIEvent& event); + + void OnUpdatePrint(wxUpdateUIEvent& event); + void OnUpdatePrintSetup(wxUpdateUIEvent& event); + void OnUpdatePreview(wxUpdateUIEvent& event); + // Extend event processing to search the view's event table virtual bool ProcessEvent(wxEvent& event); @@ -357,6 +371,9 @@ public: // Make a default document name virtual bool MakeDefaultName(wxString& buf); + // Make a frame title (override this to do something different) + virtual wxString MakeFrameTitle(wxDocument* doc); + virtual wxFileHistory *OnCreateFileHistory(); virtual wxFileHistory *GetFileHistory() const { return m_fileHistory; } @@ -378,6 +395,9 @@ public: inline wxString GetLastDirectory() const { return m_lastDirectory; } inline void SetLastDirectory(const wxString& dir) { m_lastDirectory = dir; } + // Get the current document manager + static wxDocManager* GetDocumentManager() { return sm_docManager; } + protected: long m_flags; int m_defaultDocumentNameCounter; @@ -387,6 +407,7 @@ protected: wxView* m_currentView; wxFileHistory* m_fileHistory; wxString m_lastDirectory; + static wxDocManager* sm_docManager; DECLARE_EVENT_TABLE() }; @@ -598,6 +619,11 @@ protected: // converts from/to a stream to/from a temporary file. bool WXDLLEXPORT wxTransferFileToStream(const wxString& filename, ostream& stream); bool WXDLLEXPORT wxTransferStreamToFile(istream& stream, const wxString& filename); +#else +// For compatibility with existing file formats: +// converts from/to a stream to/from a temporary file. +bool WXDLLEXPORT wxTransferFileToStream(const wxString& filename, wxOutputStream& stream); +bool WXDLLEXPORT wxTransferStreamToFile(wxInputStream& stream, const wxString& filename); #endif #endif // _WX_DOCH__