diff --git a/include/wx/bmpbndl.h b/include/wx/bmpbndl.h index 312b978c5c..2f2f099680 100644 --- a/include/wx/bmpbndl.h +++ b/include/wx/bmpbndl.h @@ -108,6 +108,9 @@ public: // Check if bitmap bundle is non-empty. bool IsOk() const { return m_impl.get() != NULL; } + // Clear the bundle contents, IsOk() will return false after doing this. + void Clear() { m_impl.reset(NULL); } + // Get the size of the bitmap represented by this bundle when using the // default DPI, i.e. 100% scaling. Returns invalid size for empty bundle. wxSize GetDefaultSize() const; diff --git a/interface/wx/bmpbndl.h b/interface/wx/bmpbndl.h index e78c900f2e..901b56d20b 100644 --- a/interface/wx/bmpbndl.h +++ b/interface/wx/bmpbndl.h @@ -288,6 +288,18 @@ public: */ static wxBitmapBundle FromSVGResource(const wxString& name, const wxSize& sizeDef); + /** + Clear the existing bundle contents. + + After calling this function IsOk() returns @false. + + This is the same as assigning a default-constructed bitmap bundle to + this object but slightly more explicit. + + @since 3.1.7 + */ + void Clear(); + /** Check if bitmap bundle is non-empty.