+ wxCHECK_RET( day > 0 && day < 32, "invalid day" );
+
+ int mask = 1 << (day - 1);
+ if ( mark )
+ m_marks |= mask;
+ else
+ m_marks &= ~mask;
+
+ // calling Refresh() here is not enough to change the day appearance
+ UpdateMarks();
+}
+
+void wxCalendarCtrl::UpdateMarks()
+{
+ MONTHDAYSTATE states[3];
+ const int nMonths = MonthCal_GetMonthRange(GetHwnd(), GMR_DAYSTATE, NULL);
+ wxCHECK_RET( nMonths <= WXSIZEOF(states), "unexpected months range" );
+
+ for ( int i = 0; i < nMonths; i++ )
+ states[i] = m_marks;
+
+ if ( !MonthCal_SetDayState(GetHwnd(), nMonths, states) )
+ {
+ wxLogLastError(_T("MonthCal_SetDayState"));
+ }