diff --git a/docs/changes.txt b/docs/changes.txt index 0c711a8f7c..c9906dde09 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -91,6 +91,12 @@ Major new features in 2.8 release 2.8.11: ------- +All: + +- Added several functions forward compatible with wxWidgets 3.0 (troelsk): + wxDC::SetDeviceClippingRegion(), wxShowEvent::IsShown(), + wxIconizeEvent::IsIconized(), wxFileName::StripExtension(). + All (GUI): - Add wxBU_EXACTFIT support to wxToggleButton XRC handler (Ronny Krueger). diff --git a/include/wx/filename.h b/include/wx/filename.h index 24b4447f16..c2f51c460f 100644 --- a/include/wx/filename.h +++ b/include/wx/filename.h @@ -481,6 +481,12 @@ public: wxString *path, wxPathFormat format = wxPATH_NATIVE); +#if wxABI_VERSION >= 20811 + // strip the file extension + static wxString StripExtension(const wxString& fullpath); +#endif // wxABI_VERSION >= 20811 + + // Filesize // returns the size of the given filename diff --git a/src/common/filename.cpp b/src/common/filename.cpp index 548c7f594d..a7abfeed86 100644 --- a/src/common/filename.cpp +++ b/src/common/filename.cpp @@ -2139,6 +2139,14 @@ void wxFileName::SplitPath(const wxString& fullpath, } } +/* static */ +wxString wxFileName::StripExtension(const wxString& fullpath) +{ + wxFileName fn(fullpath); + fn.SetExt(""); + return fn.GetFullPath(); +} + // ---------------------------------------------------------------------------- // time functions // ----------------------------------------------------------------------------