X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/d5da0ce7cb746318511b3974b7882c72c0de45e2..e0876d7381ada8459e18fc81a9e47c025778b8ec:/src/common/textcmn.cpp diff --git a/src/common/textcmn.cpp b/src/common/textcmn.cpp index f6d3bcb676..8722f3ba0c 100644 --- a/src/common/textcmn.cpp +++ b/src/common/textcmn.cpp @@ -54,6 +54,8 @@ DEFINE_EVENT_TYPE(wxEVT_COMMAND_TEXT_ENTER) DEFINE_EVENT_TYPE(wxEVT_COMMAND_TEXT_URL) DEFINE_EVENT_TYPE(wxEVT_COMMAND_TEXT_MAXLEN) +IMPLEMENT_ABSTRACT_CLASS(wxTextCtrlBase, wxControl) + // ---------------------------------------------------------------------------- // style functions - not implemented here // ---------------------------------------------------------------------------- @@ -194,7 +196,7 @@ const wxTextAttr& wxTextCtrlBase::GetDefaultStyle() const // file IO functions // ---------------------------------------------------------------------------- -bool wxTextCtrlBase::LoadFile(const wxString& filename) +bool wxTextCtrlBase::DoLoadFile(const wxString& filename, int WXUNUSED(fileType)) { #if wxUSE_FFILE wxFFile file(filename); @@ -219,7 +221,7 @@ bool wxTextCtrlBase::LoadFile(const wxString& filename) return false; } -bool wxTextCtrlBase::SaveFile(const wxString& filename) +bool wxTextCtrlBase::SaveFile(const wxString& filename, int fileType) { wxString filenameToUse = filename.empty() ? m_filename : filename; if ( filenameToUse.empty() ) @@ -230,16 +232,21 @@ bool wxTextCtrlBase::SaveFile(const wxString& filename) return false; } + return DoSaveFile(filenameToUse, fileType); +} + +bool wxTextCtrlBase::DoSaveFile(const wxString& filename, int WXUNUSED(fileType)) +{ #if wxUSE_FFILE - wxFFile file(filenameToUse, _T("w")); + wxFFile file(filename, _T("w")); if ( file.IsOpened() && file.Write(GetValue()) ) { + // if it worked, save for future calls + m_filename = filename; + // it's not modified any longer DiscardEdits(); - // if it worked, save for future calls - m_filename = filenameToUse; - return true; } #endif // wxUSE_FFILE