Commit b43639e7 authored by Chris Morgan's avatar Chris Morgan Committed by Alexandre Julliard

Fixed background redrawing when control is covered. Fixed a really

dumb mistake I made with border drawing many patches ago. Fixed offset by 1 alignment issues.
parent 62eedafb
...@@ -342,27 +342,23 @@ static void MONTHCAL_Refresh(HWND hwnd, HDC hdc, PAINTSTRUCT* ps) ...@@ -342,27 +342,23 @@ static void MONTHCAL_Refresh(HWND hwnd, HDC hdc, PAINTSTRUCT* ps)
const char *thisMonthtxt; const char *thisMonthtxt;
COLORREF oldTextColor, oldBkColor; COLORREF oldTextColor, oldBkColor;
DWORD dwStyle = GetWindowLongA(hwnd, GWL_STYLE); DWORD dwStyle = GetWindowLongA(hwnd, GWL_STYLE);
BOOL prssed;
RECT rcTemp; RECT rcTemp;
RECT rcDay; /* used in MONTHCAL_CalcDayRect() */ RECT rcDay; /* used in MONTHCAL_CalcDayRect() */
oldTextColor = SetTextColor(hdc, GetSysColor(COLOR_WINDOWTEXT)); oldTextColor = SetTextColor(hdc, GetSysColor(COLOR_WINDOWTEXT));
/* draw control edge */
if(EqualRect(&(ps->rcPaint), rcClient)) /* fill background */
{ hbr = CreateSolidBrush (infoPtr->bk);
hbr = CreateSolidBrush(RGB(255, 255, 255)); FillRect(hdc, rcClient, hbr);
FillRect(hdc, rcClient, hbr); DeleteObject(hbr);
DrawEdge(hdc, rcClient, EDGE_SUNKEN, BF_RECT);
DeleteObject(hbr);
prssed = FALSE;
}
/* draw header */ /* draw header */
if(IntersectRect(&rcTemp, &(ps->rcPaint), title)) if(IntersectRect(&rcTemp, &(ps->rcPaint), title))
{ {
hbr = CreateSolidBrush(infoPtr->titlebk); hbr = CreateSolidBrush(infoPtr->titlebk);
FillRect(hdc, title, hbr); FillRect(hdc, title, hbr);
DeleteObject(hbr);
} }
/* if the previous button is pressed draw it depressed */ /* if the previous button is pressed draw it depressed */
...@@ -419,7 +415,6 @@ static void MONTHCAL_Refresh(HWND hwnd, HDC hdc, PAINTSTRUCT* ps) ...@@ -419,7 +415,6 @@ static void MONTHCAL_Refresh(HWND hwnd, HDC hdc, PAINTSTRUCT* ps)
titlemonth->right = titlemonth->left + size.cx; titlemonth->right = titlemonth->left + size.cx;
titleyear->right = titlemonth->right; titleyear->right = titlemonth->right;
/* draw line under day abbreviatons */ /* draw line under day abbreviatons */
if(dwStyle & MCS_WEEKNUMBERS) if(dwStyle & MCS_WEEKNUMBERS)
...@@ -428,7 +423,7 @@ static void MONTHCAL_Refresh(HWND hwnd, HDC hdc, PAINTSTRUCT* ps) ...@@ -428,7 +423,7 @@ static void MONTHCAL_Refresh(HWND hwnd, HDC hdc, PAINTSTRUCT* ps)
MoveToEx(hdc, rcDraw->left + 3, title->bottom + textHeight + 2, NULL); MoveToEx(hdc, rcDraw->left + 3, title->bottom + textHeight + 2, NULL);
LineTo(hdc, rcDraw->right - 3, title->bottom + textHeight + 2); LineTo(hdc, rcDraw->right - 3, title->bottom + textHeight + 2);
/* draw day abbreviations */ /* draw day abbreviations */
SetBkColor(hdc, infoPtr->monthbk); SetBkColor(hdc, infoPtr->monthbk);
...@@ -1530,10 +1525,6 @@ static void MONTHCAL_UpdateSize(HWND hwnd) ...@@ -1530,10 +1525,6 @@ static void MONTHCAL_UpdateSize(HWND hwnd)
rcDraw->top = rcClient->top; rcDraw->top = rcClient->top;
rcDraw->bottom = rcClient->bottom; rcDraw->bottom = rcClient->bottom;
/* use DrawEdge to adjust the size of rcClient such that we */
/* do not overwrite the border when drawing the control */
DrawEdge((HDC)NULL, rcDraw, EDGE_SUNKEN, BF_RECT | BF_ADJUST);
/* this is correct, the control does NOT expand vertically */ /* this is correct, the control does NOT expand vertically */
/* like it does horizontally */ /* like it does horizontally */
/* make sure we don't move the controls bottom out of the client */ /* make sure we don't move the controls bottom out of the client */
...@@ -1543,10 +1534,10 @@ static void MONTHCAL_UpdateSize(HWND hwnd) ...@@ -1543,10 +1534,10 @@ static void MONTHCAL_UpdateSize(HWND hwnd)
} }
/* calculate title area */ /* calculate title area */
title->top = rcClient->top + 1; title->top = rcClient->top;
title->bottom = title->top + 2 * infoPtr->textHeight + 4; title->bottom = title->top + 2 * infoPtr->textHeight + 4;
title->left = rcClient->left + 1; title->left = rcClient->left;
title->right = rcClient->right - 1; title->right = rcClient->right;
/* recalculate the height and width increments and offsets */ /* recalculate the height and width increments and offsets */
infoPtr->width_increment = (infoPtr->rcDraw.right - infoPtr->rcDraw.left) / 7.0; infoPtr->width_increment = (infoPtr->rcDraw.right - infoPtr->rcDraw.left) / 7.0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment