Commit 9ce37618 authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

comctl32/monthcal: Use recently introduced enum in scroll buttons painting helper.

parent ae1062c1
...@@ -712,12 +712,12 @@ static void MONTHCAL_DrawDay(const MONTHCAL_INFO *infoPtr, HDC hdc, const SYSTEM ...@@ -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); HTHEME theme = GetWindowTheme (infoPtr->hwndSelf);
RECT *r = btnNext ? &infoPtr->titlebtnnext : &infoPtr->titlebtnprev; RECT *r = button == DIRECTION_FORWARD ? &infoPtr->titlebtnnext : &infoPtr->titlebtnprev;
BOOL pressed = btnNext ? (infoPtr->status & MC_NEXTPRESSED) : BOOL pressed = button == DIRECTION_FORWARD ? infoPtr->status & MC_NEXTPRESSED :
(infoPtr->status & MC_PREVPRESSED); infoPtr->status & MC_PREVPRESSED;
if (theme) if (theme)
{ {
static const int states[] = { static const int states[] = {
...@@ -726,7 +726,7 @@ static void MONTHCAL_PaintButton(MONTHCAL_INFO *infoPtr, HDC hdc, BOOL btnNext) ...@@ -726,7 +726,7 @@ static void MONTHCAL_PaintButton(MONTHCAL_INFO *infoPtr, HDC hdc, BOOL btnNext)
/* Next button */ /* Next button */
ABS_RIGHTNORMAL, ABS_RIGHTPRESSED, ABS_RIGHTDISABLED ABS_RIGHTNORMAL, ABS_RIGHTPRESSED, ABS_RIGHTDISABLED
}; };
int stateNum = btnNext ? 3 : 0; int stateNum = button == DIRECTION_FORWARD ? 3 : 0;
if (pressed) if (pressed)
stateNum += 1; stateNum += 1;
else else
...@@ -737,7 +737,7 @@ static void MONTHCAL_PaintButton(MONTHCAL_INFO *infoPtr, HDC hdc, BOOL btnNext) ...@@ -737,7 +737,7 @@ static void MONTHCAL_PaintButton(MONTHCAL_INFO *infoPtr, HDC hdc, BOOL btnNext)
} }
else else
{ {
int style = btnNext ? DFCS_SCROLLRIGHT : DFCS_SCROLLLEFT; int style = button == DIRECTION_FORWARD ? DFCS_SCROLLRIGHT : DFCS_SCROLLLEFT;
if (pressed) if (pressed)
style |= DFCS_PUSHED; style |= DFCS_PUSHED;
else else
...@@ -1083,8 +1083,8 @@ static void MONTHCAL_Refresh(MONTHCAL_INFO *infoPtr, HDC hdc, const PAINTSTRUCT ...@@ -1083,8 +1083,8 @@ static void MONTHCAL_Refresh(MONTHCAL_INFO *infoPtr, HDC hdc, const PAINTSTRUCT
MONTHCAL_PaintTodayTitle(infoPtr, hdc, ps); MONTHCAL_PaintTodayTitle(infoPtr, hdc, ps);
/* navigation buttons */ /* navigation buttons */
MONTHCAL_PaintButton(infoPtr, hdc, FALSE); MONTHCAL_PaintButton(infoPtr, hdc, DIRECTION_BACKWARD);
MONTHCAL_PaintButton(infoPtr, hdc, TRUE); MONTHCAL_PaintButton(infoPtr, hdc, DIRECTION_FORWARD);
/* restore context */ /* restore context */
SetBkColor(hdc, old_bk_clr); SetBkColor(hdc, old_bk_clr);
...@@ -2418,8 +2418,6 @@ static LRESULT MONTHCAL_Size(MONTHCAL_INFO *infoPtr, int Width, int Height) ...@@ -2418,8 +2418,6 @@ static LRESULT MONTHCAL_Size(MONTHCAL_INFO *infoPtr, int Width, int Height)
TRACE("(width=%d, height=%d)\n", Width, Height); TRACE("(width=%d, height=%d)\n", Width, Height);
MONTHCAL_UpdateSize(infoPtr); MONTHCAL_UpdateSize(infoPtr);
/* invalidate client area and erase background */
InvalidateRect(infoPtr->hwndSelf, NULL, TRUE); InvalidateRect(infoPtr->hwndSelf, NULL, TRUE);
return 0; return 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