Fix failing Win32 calls with checkable menu item.

Since r76202 InsertMenuItem is used when adding checkable menu items even
without a bitmap. The call fails because hbmpChecked and hbmpUnchecked are
set to HBMMENU_CALLBACK on pre-Vista, making the menu owner drawn
unnecessarily.

Fix by adding GetHBitmapForMenuCheckable which is used when assigning
values to hbmpChecked and hbmpUnchecked. GetHBitmapForMenu remains
unchanged (for possible porting reasons) and is used for hBmpItem only.


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76757 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Dimitri Schoolwerth
2014-06-23 20:05:30 +00:00
parent 1697a45b1f
commit 6b12639c49
4 changed files with 91 additions and 40 deletions

View File

@@ -117,9 +117,12 @@ private:
bool MSWMustUseOwnerDrawn();
#endif // wxUSE_OWNER_DRAWN
// helper function to get a handle of bitmap associated with item
// helper function to get a handle for normal bitmap associated with item
WXHBITMAP GetHBitmapForMenu(bool checked = true);
// helper function to get a handle for checkable bitmap associated with item
WXHBITMAP GetHBitmapForMenuCheckable(bool checked);
// helper function to set/change the bitmap
void DoSetBitmap(const wxBitmap& bmp, bool bChecked);