- Use system gray brush.

svn path=/trunk/; revision=56945
This commit is contained in:
James Tabor 2012-07-23 05:30:15 +00:00
parent 405f863521
commit 17836bbe19

View file

@ -623,19 +623,19 @@ static void UITOOLS_DrawCheckedRect( HDC dc, LPRECT rect )
{ {
if(GetSysColor(COLOR_BTNHIGHLIGHT) == RGB(255, 255, 255)) if(GetSysColor(COLOR_BTNHIGHLIGHT) == RGB(255, 255, 255))
{ {
HBITMAP hbm = CreateBitmap(8, 8, 1, 1, wPattern_AA55); // HBITMAP hbm = CreateBitmap(8, 8, 1, 1, wPattern_AA55); gpsi->hbrGray
HBRUSH hbsave; HBRUSH hbsave;
HBRUSH hb = CreatePatternBrush(hbm); // HBRUSH hb = CreatePatternBrush(hbm);
COLORREF bg; COLORREF bg;
FillRect(dc, rect, GetSysColorBrush(COLOR_BTNFACE)); FillRect(dc, rect, GetSysColorBrush(COLOR_BTNFACE));
bg = SetBkColor(dc, RGB(255, 255, 255)); bg = SetBkColor(dc, RGB(255, 255, 255));
hbsave = (HBRUSH)SelectObject(dc, hb); hbsave = (HBRUSH)SelectObject(dc, gpsi->hbrGray);
PatBlt(dc, rect->left, rect->top, rect->right-rect->left, rect->bottom-rect->top, 0x00FA0089); PatBlt(dc, rect->left, rect->top, rect->right-rect->left, rect->bottom-rect->top, 0x00FA0089);
SelectObject(dc, hbsave); SelectObject(dc, hbsave);
SetBkColor(dc, bg); SetBkColor(dc, bg);
DeleteObject(hb); // DeleteObject(hb);
DeleteObject(hbm); // DeleteObject(hbm);
} }
else else
{ {
@ -1054,9 +1054,9 @@ IntGrayString(
// correct error codes. I doubt it grays strings either... Untested! // correct error codes. I doubt it grays strings either... Untested!
BOOL success = FALSE; BOOL success = FALSE;
HBRUSH hbsave;
HDC MemDC = NULL; HDC MemDC = NULL;
HBITMAP MemBMP = NULL, HBITMAP MemBMP = NULL, OldBMP = NULL;
OldBMP = NULL;
HBRUSH OldBrush = NULL; HBRUSH OldBrush = NULL;
HFONT OldFont = NULL; HFONT OldFont = NULL;
RECT r; RECT r;
@ -1065,7 +1065,6 @@ IntGrayString(
ForeColor = SetTextColor(hDC, RGB(0, 0, 0)); ForeColor = SetTextColor(hDC, RGB(0, 0, 0));
BackColor = SetBkColor(hDC, RGB(255, 255, 255)); BackColor = SetBkColor(hDC, RGB(255, 255, 255));
if (! hBrush) if (! hBrush)
{ {
// The documentation is a little vague on what exactly should happen // The documentation is a little vague on what exactly should happen
@ -1140,11 +1139,9 @@ IntGrayString(
if (! success) goto cleanup; if (! success) goto cleanup;
PatBlt(MemDC, 0, 0, nWidth, nHeight, PATCOPY); hbsave = (HBRUSH)SelectObject(MemDC, gpsi->hbrGray);
// This is how WINE does it: (but we should have our own graying brush already) PatBlt(MemDC, 0, 0, nWidth, nHeight, 0x000A0329);
// hbsave = (HBRUSH)SelectObject(memdc, CACHE_GetPattern55AABrush()); SelectObject(MemDC, hbsave);
// PatBlt(memdc, 0, 0, cx, cy, 0x000A0329);
// SelectObject(memdc, hbsave);
} }
if (! BitBlt(hDC, X, Y, nWidth, nHeight, MemDC, 0, 0, SRCCOPY)) goto cleanup; if (! BitBlt(hDC, X, Y, nWidth, nHeight, MemDC, 0, 0, SRCCOPY)) goto cleanup;
@ -1354,17 +1351,11 @@ IntDrawState(HDC hdc, HBRUSH hbr, DRAWSTATEPROC func, LPARAM lp, WPARAM wp,
/* This state cause the image to be dithered */ /* This state cause the image to be dithered */
if(flags & DSS_UNION) if(flags & DSS_UNION)
{ {
#if 0 hbsave = (HBRUSH)SelectObject(memdc, gpsi->hbrGray);
hbsave = (HBRUSH)SelectObject(memdc, CACHE_GetPattern55AABrush()); if(!hbsave) goto cleanup;
if(!hbsave)
goto cleanup;
tmp = PatBlt(memdc, 0, 0, cx, cy, 0x00FA0089); tmp = PatBlt(memdc, 0, 0, cx, cy, 0x00FA0089);
SelectObject(memdc, hbsave); SelectObject(memdc, hbsave);
if(!tmp) if(!tmp) goto cleanup;
goto cleanup;
#else
UNIMPLEMENTED;
#endif
} }
if (flags & DSS_DISABLED) if (flags & DSS_DISABLED)
@ -1590,23 +1581,13 @@ FillRect(HDC hDC, CONST RECT *lprc, HBRUSH hbr)
BOOL WINAPI BOOL WINAPI
DrawFocusRect(HDC hdc, CONST RECT *rect) DrawFocusRect(HDC hdc, CONST RECT *rect)
{ {
static HBRUSH hFocusRectBrush = NULL;
HGDIOBJ OldObj; HGDIOBJ OldObj;
UINT cx, cy; UINT cx, cy;
if(!hFocusRectBrush)
{
static HBITMAP hFocusPattern = NULL;
const DWORD Pattern[4] = {0x5555AAAA, 0x5555AAAA, 0x5555AAAA, 0x5555AAAA};
hFocusPattern = CreateBitmap(8, 8, 1, 1, Pattern);
hFocusRectBrush = CreatePatternBrush(hFocusPattern);
}
NtUserSystemParametersInfo(SPI_GETFOCUSBORDERWIDTH, 0, &cx, 0); NtUserSystemParametersInfo(SPI_GETFOCUSBORDERWIDTH, 0, &cx, 0);
NtUserSystemParametersInfo(SPI_GETFOCUSBORDERHEIGHT, 0, &cy, 0); NtUserSystemParametersInfo(SPI_GETFOCUSBORDERHEIGHT, 0, &cy, 0);
OldObj = SelectObject(hdc, hFocusRectBrush); OldObj = SelectObject(hdc, gpsi->hbrGray);
/* top */ /* top */
PatBlt(hdc, rect->left, rect->top, rect->right - rect->left, cy, PATINVERT); PatBlt(hdc, rect->left, rect->top, rect->right - rect->left, cy, PATINVERT);