Commit 23d8d35e authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

comctl32/monthcal: Make month popup menu respect multiple calendars.

parent 09d883fb
......@@ -2046,11 +2046,23 @@ MONTHCAL_LButtonDown(MONTHCAL_INFO *infoPtr, LPARAM lParam)
i = TrackPopupMenu(hMenu,TPM_LEFTALIGN | TPM_NONOTIFY | TPM_RIGHTBUTTON | TPM_RETURNCMD,
menupoint.x, menupoint.y, 0, infoPtr->hwndSelf, NULL);
if ((i > 0) && (i < 13) && infoPtr->minSel.wMonth != i)
if ((i > 0) && (i < 13) && infoPtr->calendars[ht.iOffset].month.wMonth != i)
{
infoPtr->minSel.wMonth = i;
MONTHCAL_IsDateInValidRange(infoPtr, &infoPtr->minSel, TRUE);
InvalidateRect(infoPtr->hwndSelf, NULL, FALSE);
INT delta = i - infoPtr->calendars[ht.iOffset].month.wMonth;
SYSTEMTIME st;
/* check if change allowed by range set */
st = delta < 0 ? infoPtr->calendars[0].month :
infoPtr->calendars[infoPtr->cal_num-1].month;
MONTHCAL_GetMonth(&st, delta);
if (MONTHCAL_IsDateInValidRange(infoPtr, &st, FALSE))
{
MONTHCAL_Scroll(infoPtr, delta);
MONTHCAL_NotifyDayState(infoPtr);
MONTHCAL_NotifySelectionChange(infoPtr);
InvalidateRect(infoPtr->hwndSelf, NULL, FALSE);
}
}
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