diff --git a/include/wx/menuitem.h b/include/wx/menuitem.h index 70965abc2b..2a6608761d 100644 --- a/include/wx/menuitem.h +++ b/include/wx/menuitem.h @@ -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 diff --git a/interface/wx/menuitem.h b/interface/wx/menuitem.h index 710dc1ed04..71f07b81c5 100644 --- a/interface/wx/menuitem.h +++ b/interface/wx/menuitem.h @@ -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.