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:
@@ -185,9 +185,8 @@ bool wxBitmapButton::MSWOnDraw(WXDRAWITEMSTRUCT *item)
|
|||||||
// (for a wxMask this means that this is a non transparent pixel), the
|
// (for a wxMask this means that this is a non transparent pixel), the
|
||||||
// bg ROP is applied for all the others
|
// bg ROP is applied for all the others
|
||||||
|
|
||||||
wxColour colBg = GetBackgroundColour();
|
|
||||||
HBRUSH hbrBackground =
|
HBRUSH hbrBackground =
|
||||||
::CreateSolidBrush(RGB(colBg.Red(), colBg.Green(), colBg.Blue()));
|
::CreateSolidBrush(wxColourToRGB(GetBackgroundColour()));
|
||||||
HBRUSH hbrOld = (HBRUSH)::SelectObject(hDC, hbrBackground);
|
HBRUSH hbrOld = (HBRUSH)::SelectObject(hDC, hbrBackground);
|
||||||
|
|
||||||
ok = ::MaskBlt(
|
ok = ::MaskBlt(
|
||||||
@@ -202,6 +201,13 @@ bool wxBitmapButton::MSWOnDraw(WXDRAWITEMSTRUCT *item)
|
|||||||
::DeleteObject(hbrBackground);
|
::DeleteObject(hbrBackground);
|
||||||
}
|
}
|
||||||
else
|
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
|
#endif // Win32
|
||||||
{
|
{
|
||||||
ok = ::BitBlt(hDC, x1, y1, wBmp, hBmp, // dst
|
ok = ::BitBlt(hDC, x1, y1, wBmp, hBmp, // dst
|
||||||
|
Reference in New Issue
Block a user