[02/13] comctl32/monthcal: Use cached colors instead of GetSysColor for MonthCal
Nikolay Sivov
bunglehead at gmail.com
Mon May 18 12:19:28 CDT 2009
Changelog:
- Use cached colors instead of GetSysColor for MonthCal
>From e054e48b24c4c3a9090293ee7fe05956df2c6fd0 Mon Sep 17 00:00:00 2001
From: Nikolay Sivov <bunglehead at gmail.com>
Date: Mon, 18 May 2009 19:03:40 +0400
Subject: Use cached colors instead of GetSysColor for MonthCal
---
dlls/comctl32/monthcal.c | 18 +++++++++++-------
1 files changed, 11 insertions(+), 7 deletions(-)
diff --git a/dlls/comctl32/monthcal.c b/dlls/comctl32/monthcal.c
index 15acf1f..be41451 100644
--- a/dlls/comctl32/monthcal.c
+++ b/dlls/comctl32/monthcal.c
@@ -456,7 +456,7 @@ static void MONTHCAL_Refresh(MONTHCAL_INFO *infoPtr, HDC hdc, const PAINTSTRUCT
SYSTEMTIME localtime;
int startofprescal;
- oldTextColor = SetTextColor(hdc, GetSysColor(COLOR_WINDOWTEXT));
+ oldTextColor = SetTextColor(hdc, comctl32_color.clrWindowText);
/* fill background */
hbr = CreateSolidBrush (infoPtr->bk);
@@ -1926,12 +1926,12 @@ MONTHCAL_Create(HWND hwnd, LPARAM lParam)
infoPtr->monthRange = 3;
infoPtr->monthdayState = Alloc
(infoPtr->monthRange * sizeof(MONTHDAYSTATE));
- infoPtr->titlebk = GetSysColor(COLOR_ACTIVECAPTION);
- infoPtr->titletxt = GetSysColor(COLOR_WINDOW);
- infoPtr->monthbk = GetSysColor(COLOR_WINDOW);
- infoPtr->trailingtxt = GetSysColor(COLOR_GRAYTEXT);
- infoPtr->bk = GetSysColor(COLOR_WINDOW);
- infoPtr->txt = GetSysColor(COLOR_WINDOWTEXT);
+ infoPtr->titlebk = comctl32_color.clrActiveCaption;
+ infoPtr->titletxt = comctl32_color.clrWindow;
+ infoPtr->monthbk = comctl32_color.clrWindow;
+ infoPtr->trailingtxt = comctl32_color.clrGrayText;
+ infoPtr->bk = comctl32_color.clrWindow;
+ infoPtr->txt = comctl32_color.clrWindowText;
/* set the current day for highlighing */
infoPtr->minSel.wDay = infoPtr->todaysDate.wDay;
@@ -2082,6 +2082,10 @@ MONTHCAL_WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
case WM_DESTROY:
return MONTHCAL_Destroy(infoPtr);
+ case WM_SYSCOLORCHANGE:
+ COMCTL32_RefreshSysColors();
+ return 0;
+
default:
if ((uMsg >= WM_USER) && (uMsg < WM_APP) && !COMCTL32_IsReflectedMessage(uMsg))
ERR( "unknown msg %04x wp=%08lx lp=%08lx\n", uMsg, wParam, lParam);
--
1.5.6.5
More information about the wine-patches
mailing list