comctl32/monthcal: Store full date info for selection at creation time.
This commit is contained in:
parent
0617baf2c3
commit
d66dcb4ff8
@ -1872,25 +1872,23 @@ MONTHCAL_Create(HWND hwnd, LPCREATESTRUCTW lpcs)
|
|||||||
infoPtr->firstDayHighWord = FALSE;
|
infoPtr->firstDayHighWord = FALSE;
|
||||||
MONTHCAL_SetFirstDayOfWeek(infoPtr, -1);
|
MONTHCAL_SetFirstDayOfWeek(infoPtr, -1);
|
||||||
infoPtr->currentMonth = infoPtr->todaysDate.wMonth;
|
infoPtr->currentMonth = infoPtr->todaysDate.wMonth;
|
||||||
infoPtr->currentYear = infoPtr->todaysDate.wYear;
|
infoPtr->currentYear = infoPtr->todaysDate.wYear;
|
||||||
infoPtr->minDate = infoPtr->todaysDate;
|
infoPtr->minDate = infoPtr->todaysDate;
|
||||||
infoPtr->maxDate = infoPtr->todaysDate;
|
infoPtr->maxDate = infoPtr->todaysDate;
|
||||||
infoPtr->maxDate.wYear=2050;
|
infoPtr->maxDate.wYear = 2050;
|
||||||
infoPtr->minDate.wYear=1950;
|
infoPtr->minDate.wYear = 1950;
|
||||||
infoPtr->maxSelCount = 7;
|
infoPtr->maxSelCount = 7;
|
||||||
infoPtr->monthRange = 3;
|
infoPtr->monthRange = 3;
|
||||||
infoPtr->monthdayState = Alloc
|
infoPtr->monthdayState = Alloc(infoPtr->monthRange * sizeof(MONTHDAYSTATE));
|
||||||
(infoPtr->monthRange * sizeof(MONTHDAYSTATE));
|
infoPtr->titlebk = comctl32_color.clrActiveCaption;
|
||||||
infoPtr->titlebk = comctl32_color.clrActiveCaption;
|
infoPtr->titletxt = comctl32_color.clrWindow;
|
||||||
infoPtr->titletxt = comctl32_color.clrWindow;
|
infoPtr->monthbk = comctl32_color.clrWindow;
|
||||||
infoPtr->monthbk = comctl32_color.clrWindow;
|
infoPtr->trailingtxt = comctl32_color.clrGrayText;
|
||||||
infoPtr->trailingtxt = comctl32_color.clrGrayText;
|
infoPtr->bk = comctl32_color.clrWindow;
|
||||||
infoPtr->bk = comctl32_color.clrWindow;
|
infoPtr->txt = comctl32_color.clrWindowText;
|
||||||
infoPtr->txt = comctl32_color.clrWindowText;
|
|
||||||
|
|
||||||
/* set the current day for highlighing */
|
infoPtr->minSel = infoPtr->todaysDate;
|
||||||
infoPtr->minSel.wDay = infoPtr->todaysDate.wDay;
|
infoPtr->maxSel = infoPtr->todaysDate;
|
||||||
infoPtr->maxSel.wDay = infoPtr->todaysDate.wDay;
|
|
||||||
|
|
||||||
/* call MONTHCAL_UpdateSize to set all of the dimensions */
|
/* call MONTHCAL_UpdateSize to set all of the dimensions */
|
||||||
/* of the control */
|
/* of the control */
|
||||||
|
@ -1237,6 +1237,41 @@ static void test_monthcal_destroy(void)
|
|||||||
ok_sequence(sequences, MONTHCAL_SEQ_INDEX, destroy_monthcal_multi_sel_style_seq, "Destroy monthcal (multi sel style)", FALSE);
|
ok_sequence(sequences, MONTHCAL_SEQ_INDEX, destroy_monthcal_multi_sel_style_seq, "Destroy monthcal (multi sel style)", FALSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void test_monthcal_getselrange(void)
|
||||||
|
{
|
||||||
|
HWND hwnd;
|
||||||
|
SYSTEMTIME st, range[2];
|
||||||
|
BOOL ret;
|
||||||
|
|
||||||
|
hwnd = create_monthcal_control(MCS_MULTISELECT);
|
||||||
|
|
||||||
|
/* just after creation selection should start and end today */
|
||||||
|
ret = SendMessage(hwnd, MCM_GETTODAY, 0, (LPARAM)&st);
|
||||||
|
expect(TRUE, ret);
|
||||||
|
|
||||||
|
ret = SendMessage(hwnd, MCM_GETSELRANGE, 0, (LPARAM)range);
|
||||||
|
expect(TRUE, ret);
|
||||||
|
expect(st.wYear, range[0].wYear);
|
||||||
|
expect(st.wMonth, range[0].wMonth);
|
||||||
|
expect(st.wDay, range[0].wDay);
|
||||||
|
expect(st.wDayOfWeek, range[0].wDayOfWeek);
|
||||||
|
expect(st.wHour, range[0].wHour);
|
||||||
|
expect(st.wMinute, range[0].wMinute);
|
||||||
|
expect(st.wSecond, range[0].wSecond);
|
||||||
|
expect(st.wMilliseconds, range[0].wMilliseconds);
|
||||||
|
|
||||||
|
expect(st.wYear, range[1].wYear);
|
||||||
|
expect(st.wMonth, range[1].wMonth);
|
||||||
|
expect(st.wDay, range[1].wDay);
|
||||||
|
expect(st.wDayOfWeek, range[1].wDayOfWeek);
|
||||||
|
expect(st.wHour, range[1].wHour);
|
||||||
|
expect(st.wMinute, range[1].wMinute);
|
||||||
|
expect(st.wSecond, range[1].wSecond);
|
||||||
|
expect(st.wMilliseconds, range[1].wMilliseconds);
|
||||||
|
|
||||||
|
DestroyWindow(hwnd);
|
||||||
|
}
|
||||||
|
|
||||||
START_TEST(monthcal)
|
START_TEST(monthcal)
|
||||||
{
|
{
|
||||||
HMODULE hComctl32;
|
HMODULE hComctl32;
|
||||||
@ -1273,6 +1308,7 @@ START_TEST(monthcal)
|
|||||||
test_monthcal_todaylink();
|
test_monthcal_todaylink();
|
||||||
test_monthcal_size();
|
test_monthcal_size();
|
||||||
test_monthcal_maxselday();
|
test_monthcal_maxselday();
|
||||||
|
test_monthcal_getselrange();
|
||||||
|
|
||||||
flush_sequences(sequences, NUM_MSG_SEQUENCES);
|
flush_sequences(sequences, NUM_MSG_SEQUENCES);
|
||||||
DestroyWindow(parent_wnd);
|
DestroyWindow(parent_wnd);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user