Module: wine Branch: master Commit: 7beaa88ed9efcb048595f56e403dca16363a4486 URL: http://source.winehq.org/git/wine.git/?a=commit;h=7beaa88ed9efcb048595f56e40...
Author: Nikolay Sivov bunglehead@gmail.com Date: Tue Oct 13 04:16:31 2009 +0400
comctl32/monthcal: Implement handler for WM_ERASEBKGND.
---
dlls/comctl32/monthcal.c | 28 ++++++++++++++++++++-------- 1 files changed, 20 insertions(+), 8 deletions(-)
diff --git a/dlls/comctl32/monthcal.c b/dlls/comctl32/monthcal.c index dc61d01..8440e15 100644 --- a/dlls/comctl32/monthcal.c +++ b/dlls/comctl32/monthcal.c @@ -1015,8 +1015,7 @@ static void MONTHCAL_PaintCalendar(MONTHCAL_INFO *infoPtr, HDC hdc, const PAINTS
static void MONTHCAL_Refresh(MONTHCAL_INFO *infoPtr, HDC hdc, const PAINTSTRUCT *ps) { - RECT *title=&infoPtr->title; - HBRUSH hbr; + RECT *title = &infoPtr->title; COLORREF old_text_clr, old_bk_clr; HFONT old_font; RECT r_temp; @@ -1025,11 +1024,6 @@ static void MONTHCAL_Refresh(MONTHCAL_INFO *infoPtr, HDC hdc, const PAINTSTRUCT old_bk_clr = GetBkColor(hdc); old_font = GetCurrentObject(hdc, OBJ_FONT);
- /* fill background */ - hbr = CreateSolidBrush (infoPtr->bk); - FillRect(hdc, &ps->rcPaint, hbr); - DeleteObject(hbr); - /* draw title, redraw all its elements */ if(IntersectRect(&r_temp, &(ps->rcPaint), title)) MONTHCAL_PaintTitle(infoPtr, hdc, ps); @@ -1048,7 +1042,6 @@ static void MONTHCAL_Refresh(MONTHCAL_INFO *infoPtr, HDC hdc, const PAINTSTRUCT SetTextColor(hdc, old_text_clr); }
- static LRESULT MONTHCAL_GetMinReqRect(const MONTHCAL_INFO *infoPtr, LPRECT lpRect) { @@ -2114,6 +2107,22 @@ MONTHCAL_Paint(MONTHCAL_INFO *infoPtr, HDC hdc_paint) }
static LRESULT +MONTHCAL_EraseBkgnd(const MONTHCAL_INFO *infoPtr, HDC hdc) +{ + HBRUSH hbr; + RECT rc; + + if (!GetClipBox(hdc, &rc)) return FALSE; + + /* fill background */ + hbr = CreateSolidBrush (infoPtr->bk); + FillRect(hdc, &rc, hbr); + DeleteObject(hbr); + + return TRUE; +} + +static LRESULT MONTHCAL_SetFocus(const MONTHCAL_INFO *infoPtr) { TRACE("\n"); @@ -2529,6 +2538,9 @@ MONTHCAL_WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) case WM_PAINT: return MONTHCAL_Paint(infoPtr, (HDC)wParam);
+ case WM_ERASEBKGND: + return MONTHCAL_EraseBkgnd(infoPtr, (HDC)wParam); + case WM_SETFOCUS: return MONTHCAL_SetFocus(infoPtr);