fix for drawing bitmap buttons under Win95 (untested)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@6024 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
parent
530a7383f2
commit
6148d1e6e9
@ -185,9 +185,8 @@ bool wxBitmapButton::MSWOnDraw(WXDRAWITEMSTRUCT *item)
|
||||
// (for a wxMask this means that this is a non transparent pixel), the
|
||||
// bg ROP is applied for all the others
|
||||
|
||||
wxColour colBg = GetBackgroundColour();
|
||||
HBRUSH hbrBackground =
|
||||
::CreateSolidBrush(RGB(colBg.Red(), colBg.Green(), colBg.Blue()));
|
||||
::CreateSolidBrush(wxColourToRGB(GetBackgroundColour()));
|
||||
HBRUSH hbrOld = (HBRUSH)::SelectObject(hDC, hbrBackground);
|
||||
|
||||
ok = ::MaskBlt(
|
||||
@ -202,6 +201,13 @@ bool wxBitmapButton::MSWOnDraw(WXDRAWITEMSTRUCT *item)
|
||||
::DeleteObject(hbrBackground);
|
||||
}
|
||||
else
|
||||
{
|
||||
// this will make the check below fail and BitBlt() will be used if
|
||||
// MaskBlt() is not supported (for example, under Win95)
|
||||
ok = FALSE;
|
||||
}
|
||||
|
||||
if ( !ok )
|
||||
#endif // Win32
|
||||
{
|
||||
ok = ::BitBlt(hDC, x1, y1, wBmp, hBmp, // dst
|
||||
|
Loading…
Reference in New Issue
Block a user