Move GetBitmapFromBundle() to wxMenuItemBase

This is just a refactoring to avoid duplicating this function code in
all ports and just have it once in the base class.
This commit is contained in:
Vadim Zeitlin
2022-02-05 20:35:46 +01:00
parent bec31f1919
commit 338cd95c2d
8 changed files with 25 additions and 49 deletions

View File

@@ -688,22 +688,6 @@ void wxMenuItem::SetItemLabel(const wxString& txt)
}
}
wxBitmap wxMenuItem::GetBitmapFromBundle(const wxBitmapBundle& bundle) const
{
if (bundle.IsOk())
{
if (m_parentMenu && m_parentMenu->GetWindow())
{
return bundle.GetBitmapFor(m_parentMenu->GetWindow());
}
else
{
return bundle.GetBitmap(wxDefaultSize);
}
}
return wxNullBitmap;
}
wxBitmap wxMenuItem::GetBitmap(bool bChecked) const
{
wxBitmap bmp = GetBitmapFromBundle(bChecked ? m_bmpChecked : m_bmpUnchecked);