Fix setting menu item bitmaps after appending them in wxMSW.
Update the bitmap used by Windows when using non-owner-drawn items with bitmaps. Closes #9388. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76191 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -77,18 +77,13 @@ public:
|
||||
void SetBitmaps(const wxBitmap& bmpChecked,
|
||||
const wxBitmap& bmpUnchecked = wxNullBitmap)
|
||||
{
|
||||
m_bmpChecked = bmpChecked;
|
||||
m_bmpUnchecked = bmpUnchecked;
|
||||
SetOwnerDrawn(true);
|
||||
DoSetBitmap(bmpChecked, true);
|
||||
DoSetBitmap(bmpUnchecked, false);
|
||||
}
|
||||
|
||||
void SetBitmap(const wxBitmap& bmp, bool bChecked = true)
|
||||
{
|
||||
if ( bChecked )
|
||||
m_bmpChecked = bmp;
|
||||
else
|
||||
m_bmpUnchecked = bmp;
|
||||
SetOwnerDrawn(true);
|
||||
DoSetBitmap(bmp, bChecked);
|
||||
}
|
||||
|
||||
void SetDisabledBitmap(const wxBitmap& bmpDisabled)
|
||||
@@ -124,6 +119,9 @@ private:
|
||||
// helper function to get a handle of bitmap associated with item
|
||||
WXHBITMAP GetHBitmapForMenu(bool checked = true);
|
||||
|
||||
// helper function to set/change the bitmap
|
||||
void DoSetBitmap(const wxBitmap& bmp, bool bChecked);
|
||||
|
||||
#else // !wxUSE_OWNER_DRAWN
|
||||
// Provide stubs for the public functions above to ensure that the code
|
||||
// still compiles without wxUSE_OWNER_DRAWN -- it makes sense to just drop
|
||||
|
Reference in New Issue
Block a user