From 9ce376181a14e68c72e7c0d42cabec9b72b0f09d Mon Sep 17 00:00:00 2001 From: Nikolay Sivov Date: Sun, 8 Aug 2010 17:24:38 +0400 Subject: [PATCH] comctl32/monthcal: Use recently introduced enum in scroll buttons painting helper. --- dlls/comctl32/monthcal.c | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/dlls/comctl32/monthcal.c b/dlls/comctl32/monthcal.c index ac426c0bf45..1cc64dbd524 100644 --- a/dlls/comctl32/monthcal.c +++ b/dlls/comctl32/monthcal.c @@ -712,12 +712,12 @@ static void MONTHCAL_DrawDay(const MONTHCAL_INFO *infoPtr, HDC hdc, const SYSTEM } -static void MONTHCAL_PaintButton(MONTHCAL_INFO *infoPtr, HDC hdc, BOOL btnNext) +static void MONTHCAL_PaintButton(MONTHCAL_INFO *infoPtr, HDC hdc, enum nav_direction button) { HTHEME theme = GetWindowTheme (infoPtr->hwndSelf); - RECT *r = btnNext ? &infoPtr->titlebtnnext : &infoPtr->titlebtnprev; - BOOL pressed = btnNext ? (infoPtr->status & MC_NEXTPRESSED) : - (infoPtr->status & MC_PREVPRESSED); + RECT *r = button == DIRECTION_FORWARD ? &infoPtr->titlebtnnext : &infoPtr->titlebtnprev; + BOOL pressed = button == DIRECTION_FORWARD ? infoPtr->status & MC_NEXTPRESSED : + infoPtr->status & MC_PREVPRESSED; if (theme) { static const int states[] = { @@ -726,7 +726,7 @@ static void MONTHCAL_PaintButton(MONTHCAL_INFO *infoPtr, HDC hdc, BOOL btnNext) /* Next button */ ABS_RIGHTNORMAL, ABS_RIGHTPRESSED, ABS_RIGHTDISABLED }; - int stateNum = btnNext ? 3 : 0; + int stateNum = button == DIRECTION_FORWARD ? 3 : 0; if (pressed) stateNum += 1; else @@ -737,7 +737,7 @@ static void MONTHCAL_PaintButton(MONTHCAL_INFO *infoPtr, HDC hdc, BOOL btnNext) } else { - int style = btnNext ? DFCS_SCROLLRIGHT : DFCS_SCROLLLEFT; + int style = button == DIRECTION_FORWARD ? DFCS_SCROLLRIGHT : DFCS_SCROLLLEFT; if (pressed) style |= DFCS_PUSHED; else @@ -1083,8 +1083,8 @@ static void MONTHCAL_Refresh(MONTHCAL_INFO *infoPtr, HDC hdc, const PAINTSTRUCT MONTHCAL_PaintTodayTitle(infoPtr, hdc, ps); /* navigation buttons */ - MONTHCAL_PaintButton(infoPtr, hdc, FALSE); - MONTHCAL_PaintButton(infoPtr, hdc, TRUE); + MONTHCAL_PaintButton(infoPtr, hdc, DIRECTION_BACKWARD); + MONTHCAL_PaintButton(infoPtr, hdc, DIRECTION_FORWARD); /* restore context */ SetBkColor(hdc, old_bk_clr); @@ -2418,8 +2418,6 @@ static LRESULT MONTHCAL_Size(MONTHCAL_INFO *infoPtr, int Width, int Height) TRACE("(width=%d, height=%d)\n", Width, Height); MONTHCAL_UpdateSize(infoPtr); - - /* invalidate client area and erase background */ InvalidateRect(infoPtr->hwndSelf, NULL, TRUE); return 0;