Draw the selected bitmap correctly in wxMSW buttons.

Clear the previously drawn bitmap before drawing the new one.

Closes #12550.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@75664 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin 2014-01-21 18:39:09 +00:00
parent 82a774cf98
commit c96fc29a52
2 changed files with 8 additions and 1 deletions

View File

@ -27,3 +27,4 @@ wxMSW:
- Improve wxMimeTypesManager open command detection (Eric Jensen).
- Make wxFILTER_INCLUDE_LIST in wxTextValidator actually usable.
- Fix handling of selected images in wxBitmapButton (Artur Wieczorek).

View File

@ -1175,7 +1175,13 @@ bool wxAnyButton::MSWOnDraw(WXDRAWITEMSTRUCT *wxdis)
}
}
}
else
{
// clear the background (and erase any previous bitmap)
COLORREF colBg = wxColourToRGB(GetBackgroundColour());
AutoHBRUSH hbrushBackground(colBg);
FillRect(hdc, &rectBtn, hbrushBackground);
}
// draw the image, if any
if ( m_imageData )