Commit 96022da6 authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

comctl32/monthcal: Implement MCM_GETMONTHRANGE for GMR_VISIBLE flag, single calendar control only.

parent ec3e9308
......@@ -936,10 +936,29 @@ MONTHCAL_SetFirstDayOfWeek(MONTHCAL_INFO *infoPtr, INT day)
static LRESULT
MONTHCAL_GetMonthRange(const MONTHCAL_INFO *infoPtr)
MONTHCAL_GetMonthRange(const MONTHCAL_INFO *infoPtr, DWORD flag, SYSTEMTIME *st)
{
TRACE("\n");
if(st)
{
if(flag == GMR_VISIBLE)
{
/*FIXME: currently multicalendar feature isn't implelented, so entirely
visible month is current */
st[0] = st[1] = infoPtr->curSel;
st[0].wDay = 1;
st[0].wDayOfWeek = MONTHCAL_CalculateDayOfWeek(1, st[0].wMonth, st[0].wYear);
st[1].wDay = MONTHCAL_MonthLength(st[1].wMonth, st[1].wYear);
st[1].wDayOfWeek = MONTHCAL_CalculateDayOfWeek(st[1].wDay, st[1].wMonth,
st[1].wYear);
}
else
FIXME("only GMR_VISIBLE flag supported, got %d\n", flag);
}
return infoPtr->monthRange;
}
......@@ -2053,7 +2072,7 @@ MONTHCAL_WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
return MONTHCAL_SetSelRange(infoPtr, (LPSYSTEMTIME)lParam);
case MCM_GETMONTHRANGE:
return MONTHCAL_GetMonthRange(infoPtr);
return MONTHCAL_GetMonthRange(infoPtr, wParam, (SYSTEMTIME*)lParam);
case MCM_SETDAYSTATE:
return MONTHCAL_SetDayState(infoPtr, (INT)wParam, (LPMONTHDAYSTATE)lParam);
......
......@@ -1323,10 +1323,13 @@ static void test_monthcal_monthrange(void)
res = SendMessage(hwnd, MCM_GETMONTHRANGE, GMR_VISIBLE, (LPARAM)st_visible);
todo_wine {
expect(2, res);
}
expect(2000, st_visible[0].wYear);
expect(11, st_visible[0].wMonth);
expect(1, st_visible[0].wDay);
expect(2000, st_visible[1].wYear);
todo_wine {
expect(12, st_visible[1].wMonth);
expect(31, st_visible[1].wDay);
}
......
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