mirror of
https://github.com/reactos/reactos.git
synced 2024-11-04 22:00:55 +00:00
[TIMEDATE] Make the custom clock control aware of the theming. By Carlo Bramini. CORE-12079
svn path=/trunk/; revision=73214
This commit is contained in:
parent
8c25d803dd
commit
aca585d81e
1 changed files with 11 additions and 10 deletions
|
@ -182,20 +182,18 @@ ClockWndProc(HWND hwnd,
|
||||||
pClockData->cyClient);
|
pClockData->cyClient);
|
||||||
if (hBmp)
|
if (hBmp)
|
||||||
{
|
{
|
||||||
HBRUSH hWinBrush, hWinBrushOld;
|
RECT rcParent;
|
||||||
|
HWND hParentWnd = GetParent(hwnd);
|
||||||
INT oldMap, Radius;
|
INT oldMap, Radius;
|
||||||
POINT oldOrg;
|
POINT oldOrg;
|
||||||
|
|
||||||
hBmpOld = SelectObject(hdcMem, hBmp);
|
hBmpOld = SelectObject(hdcMem, hBmp);
|
||||||
|
|
||||||
hWinBrush = GetSysColorBrush(COLOR_BTNFACE);
|
SetRect(&rcParent, 0, 0, pClockData->cxClient, pClockData->cyClient);
|
||||||
hWinBrushOld = SelectObject(hdcMem, hWinBrush);
|
MapWindowPoints(hwnd, hParentWnd, (POINT*)&rcParent, 2);
|
||||||
PatBlt(hdcMem,
|
OffsetViewportOrgEx(hdcMem, -rcParent.left, -rcParent.top, &oldOrg);
|
||||||
0,
|
SendMessage(hParentWnd, WM_PRINT, (WPARAM)hdcMem, PRF_ERASEBKGND | PRF_CLIENT);
|
||||||
0,
|
SetViewportOrgEx(hdcMem, oldOrg.x, oldOrg.y, NULL);
|
||||||
pClockData->cxClient,
|
|
||||||
pClockData->cyClient,
|
|
||||||
PATCOPY);
|
|
||||||
|
|
||||||
oldMap = SetMapMode(hdcMem, MM_ISOTROPIC);
|
oldMap = SetMapMode(hdcMem, MM_ISOTROPIC);
|
||||||
SetWindowExtEx(hdcMem, 3600, 2700, NULL);
|
SetWindowExtEx(hdcMem, 3600, 2700, NULL);
|
||||||
|
@ -221,7 +219,6 @@ ClockWndProc(HWND hwnd,
|
||||||
0,
|
0,
|
||||||
SRCCOPY);
|
SRCCOPY);
|
||||||
|
|
||||||
SelectObject(hdcMem, hWinBrushOld);
|
|
||||||
SelectObject(hdcMem, hBmpOld);
|
SelectObject(hdcMem, hBmpOld);
|
||||||
DeleteObject(hBmp);
|
DeleteObject(hBmp);
|
||||||
}
|
}
|
||||||
|
@ -232,6 +229,10 @@ ClockWndProc(HWND hwnd,
|
||||||
EndPaint(hwnd, &ps);
|
EndPaint(hwnd, &ps);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
/* No need to erase background, handled during paint */
|
||||||
|
case WM_ERASEBKGND:
|
||||||
|
return 1;
|
||||||
|
|
||||||
case WM_DESTROY:
|
case WM_DESTROY:
|
||||||
DeleteObject(pClockData->hGreyPen);
|
DeleteObject(pClockData->hGreyPen);
|
||||||
DeleteObject(pClockData->hGreyBrush);
|
DeleteObject(pClockData->hGreyBrush);
|
||||||
|
|
Loading…
Reference in a new issue