From b43639e76e342d39af78b3404fa00e3aed040b63 Mon Sep 17 00:00:00 2001 From: Chris Morgan Date: Sat, 8 Jul 2000 11:43:57 +0000 Subject: [PATCH] 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. --- dlls/comctl32/monthcal.c | 29 ++++++++++------------------- 1 file changed, 10 insertions(+), 19 deletions(-) diff --git a/dlls/comctl32/monthcal.c b/dlls/comctl32/monthcal.c index 5fcf2f68524..36396010ddd 100644 --- a/dlls/comctl32/monthcal.c +++ b/dlls/comctl32/monthcal.c @@ -342,27 +342,23 @@ static void MONTHCAL_Refresh(HWND hwnd, HDC hdc, PAINTSTRUCT* ps) const char *thisMonthtxt; COLORREF oldTextColor, oldBkColor; DWORD dwStyle = GetWindowLongA(hwnd, GWL_STYLE); - BOOL prssed; RECT rcTemp; RECT rcDay; /* used in MONTHCAL_CalcDayRect() */ oldTextColor = SetTextColor(hdc, GetSysColor(COLOR_WINDOWTEXT)); - /* draw control edge */ - if(EqualRect(&(ps->rcPaint), rcClient)) - { - hbr = CreateSolidBrush(RGB(255, 255, 255)); - FillRect(hdc, rcClient, hbr); - DrawEdge(hdc, rcClient, EDGE_SUNKEN, BF_RECT); - DeleteObject(hbr); - prssed = FALSE; - } + + /* fill background */ + hbr = CreateSolidBrush (infoPtr->bk); + FillRect(hdc, rcClient, hbr); + DeleteObject(hbr); /* draw header */ if(IntersectRect(&rcTemp, &(ps->rcPaint), title)) { hbr = CreateSolidBrush(infoPtr->titlebk); FillRect(hdc, title, hbr); + DeleteObject(hbr); } /* if the previous button is pressed draw it depressed */ @@ -419,7 +415,6 @@ static void MONTHCAL_Refresh(HWND hwnd, HDC hdc, PAINTSTRUCT* ps) titlemonth->right = titlemonth->left + size.cx; titleyear->right = titlemonth->right; - /* draw line under day abbreviatons */ if(dwStyle & MCS_WEEKNUMBERS) @@ -428,7 +423,7 @@ static void MONTHCAL_Refresh(HWND hwnd, HDC hdc, PAINTSTRUCT* ps) MoveToEx(hdc, rcDraw->left + 3, title->bottom + textHeight + 2, NULL); LineTo(hdc, rcDraw->right - 3, title->bottom + textHeight + 2); - + /* draw day abbreviations */ SetBkColor(hdc, infoPtr->monthbk); @@ -1530,10 +1525,6 @@ static void MONTHCAL_UpdateSize(HWND hwnd) rcDraw->top = rcClient->top; 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 */ /* like it does horizontally */ /* make sure we don't move the controls bottom out of the client */ @@ -1543,10 +1534,10 @@ static void MONTHCAL_UpdateSize(HWND hwnd) } /* calculate title area */ - title->top = rcClient->top + 1; + title->top = rcClient->top; title->bottom = title->top + 2 * infoPtr->textHeight + 4; - title->left = rcClient->left + 1; - title->right = rcClient->right - 1; + title->left = rcClient->left; + title->right = rcClient->right; /* recalculate the height and width increments and offsets */ infoPtr->width_increment = (infoPtr->rcDraw.right - infoPtr->rcDraw.left) / 7.0; -- 2.11.4.GIT