Add wxMenuItem::GetBitmapBundle()

This is needed to e.g. allow cloning a wxMenuItem fully without losing
any of its data.
This commit is contained in:
Vadim Zeitlin 2022-06-15 02:01:53 +01:00
parent d0b32e71f5
commit 5f8b900078
2 changed files with 19 additions and 0 deletions

View file

@ -118,6 +118,10 @@ public:
// bitmap-related functions
virtual void SetBitmap(const wxBitmapBundle& bmp);
wxBitmapBundle GetBitmapBundle() const { return m_bitmap; }
// This method only exists for compatibility, prefer using
// GetBitmapBundle() in the new code.
virtual wxBitmap GetBitmap() const;
#if wxUSE_ACCEL

View file

@ -162,6 +162,9 @@ public:
/**
Returns the item bitmap.
This method exists only for compatibility, please use GetBitmapBundle()
in the new code.
*/
wxBitmap GetBitmap() const;
@ -172,6 +175,18 @@ public:
*/
wxBitmap GetBitmap(bool checked) const;
/**
Returns the bitmap bundle containing the bitmap used for this item.
The returned bundle is invalid, i.e. empty, if no bitmap is associated
with the item.
@see SetBitmap()
@since 3.2.0
*/
wxBitmapBundle GetBitmapBundle() const;
/**
Returns the bitmap used for disabled items.