Add wxBitmapBundle::Clear()

This is just a convenient helper for resetting the bundle contents which
seems more readable than assigning an empty bundle to it.
This commit is contained in:
Vadim Zeitlin 2022-05-08 15:54:51 +01:00
parent b6fb5109c0
commit dc90e92110
2 changed files with 15 additions and 0 deletions

View file

@ -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;

View file

@ -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.