mirror of
https://github.com/reactos/reactos.git
synced 2025-08-04 00:45:49 +00:00
draw patterned focus rectangles
svn path=/trunk/; revision=8985
This commit is contained in:
parent
bea76aded5
commit
0a552285f3
1 changed files with 20 additions and 28 deletions
|
@ -1843,39 +1843,31 @@ DrawAnimatedRects(HWND hWnd, int idAni, CONST RECT *lprcFrom,
|
||||||
BOOL STDCALL
|
BOOL STDCALL
|
||||||
DrawFocusRect(HDC hdc, CONST RECT *rect)
|
DrawFocusRect(HDC hdc, CONST RECT *rect)
|
||||||
{
|
{
|
||||||
/* FIXME PS_ALTERNATE and R2_XORPEN not yet implemented */
|
static HBRUSH hFocusRectBrush = NULL;
|
||||||
#if 0
|
HGDIOBJ OldObj;
|
||||||
HBRUSH hOldBrush;
|
|
||||||
HPEN hOldPen, hNewPen;
|
if(!hFocusRectBrush)
|
||||||
INT oldDrawMode, oldBkMode;
|
{
|
||||||
|
static HBITMAP hFocusPattern = NULL;
|
||||||
hOldBrush = SelectObject(hdc, GetStockObject(NULL_BRUSH));
|
const DWORD Pattern[4] = {0x5555AAAA, 0x5555AAAA, 0x5555AAAA, 0x5555AAAA};
|
||||||
hNewPen = CreatePen(PS_ALTERNATE, 1, GetSysColor(COLOR_WINDOWTEXT));
|
|
||||||
hOldPen = SelectObject(hdc, hNewPen);
|
hFocusPattern = CreateBitmap(8, 8, 1, 1, Pattern);
|
||||||
oldDrawMode = SetROP2(hdc, R2_XORPEN);
|
hFocusRectBrush = CreatePatternBrush(hFocusPattern);
|
||||||
oldBkMode = SetBkMode(hdc, TRANSPARENT);
|
}
|
||||||
|
|
||||||
Rectangle(hdc, rect->left, rect->top, rect->right, rect->bottom);
|
OldObj = SelectObject(hdc, hFocusRectBrush);
|
||||||
|
|
||||||
SetBkMode(hdc, oldBkMode);
|
|
||||||
SetROP2(hdc, oldDrawMode);
|
|
||||||
SelectObject(hdc, hOldPen);
|
|
||||||
DeleteObject(hNewPen);
|
|
||||||
SelectObject(hdc, hOldBrush);
|
|
||||||
|
|
||||||
return TRUE;
|
|
||||||
#else
|
|
||||||
PatBlt(hdc, rect->left, rect->top,
|
PatBlt(hdc, rect->left, rect->top,
|
||||||
rect->right - rect->left - 1, 1, DSTINVERT);
|
rect->right - rect->left - 1, 1, PATINVERT);
|
||||||
PatBlt(hdc, rect->left, rect->top + 1, 1,
|
PatBlt(hdc, rect->left, rect->top + 1, 1,
|
||||||
rect->bottom - rect->top - 1, DSTINVERT);
|
rect->bottom - rect->top - 1, PATINVERT);
|
||||||
PatBlt(hdc, rect->left + 1, rect->bottom - 1,
|
PatBlt(hdc, rect->left + 1, rect->bottom - 1,
|
||||||
rect->right - rect->left - 1, -1, DSTINVERT);
|
rect->right - rect->left - 1, -1, PATINVERT);
|
||||||
PatBlt(hdc, rect->right - 1, rect->top, -1,
|
PatBlt(hdc, rect->right - 1, rect->top, -1,
|
||||||
rect->bottom - rect->top - 1, DSTINVERT);
|
rect->bottom - rect->top - 1, PATINVERT);
|
||||||
|
|
||||||
|
SelectObject(hdc, OldObj);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue