bool CDate::WithinDays(CDate d, BYTE n) { if( d > *this ) { return (d.GetDayCount()-GetDayCount())<=n; } else { return (GetDayCount()-d.GetDayCount())<=n; } }
void CXTPDatePickerItemMonth::ClearDays() { // cleanup old month array int nOldDayCount = GetDayCount(); for (int nDay = 0; nDay < nOldDayCount; nDay++) { CXTPDatePickerItemDay* pDay = GetDay(nDay); pDay->InternalRelease(); } m_arrDays.RemoveAll(); }
void CDxDatePickerMonth::ClearDays() { // cleanup old month array int nOldDayCount = GetDayCount(); for (int nDay = 0; nDay < nOldDayCount; nDay++) { CDxDatePickerDay* pDay = GetDay(nDay); delete pDay; } m_arrDays.RemoveAll(); }
void CBCGPRecurrenceRuleWeekly::SetDays (DWORD dwDays) { ASSERT (dwDays > 0); if (m_dwDays != dwDays && dwDays != 0) { m_dwDays = dwDays; m_FirstDay = GetFirstDay (); m_LastDay = GetLastDay (); m_nCount = GetDayCount (); } }
CDxDatePickerDay* CDxDatePickerMonth::HitTest(CPoint point, BOOL bCheckVisible) const { // enumerate month array int nDayCount = GetDayCount(); for (int nDay = 0; nDay < nDayCount; nDay++) { CDxDatePickerDay* pDay = GetDay(nDay); if (pDay && pDay->GetRect().PtInRect(point) && (pDay->IsVisible() || !bCheckVisible)) { return pDay; } } return NULL; }
void CDxDatePickerMonth::Draw(CDCHandle dc) { // draw header DrawMonthHeader(dc); // draw days of week DrawDaysOfWeek(dc); // draw all days int nDaysCount = GetDayCount(); for (int nIndex = 0; nIndex < nDaysCount; nIndex++) { CDxDatePickerDay* pDay = GetDay(nIndex); pDay->Draw(dc); } }
void CXTPDatePickerItemMonth::Draw(CDC* pDC) { // draw header CXTPDatePickerPaintManager* pPaintManager = m_pControl->GetPaintManager(); pPaintManager->DrawMonthHeader(pDC, this); // draw days of week pPaintManager->DrawDaysOfWeek(pDC, this); // draw all days int nDaysCount = GetDayCount(); for (int nIndex = 0; nIndex < nDaysCount; nIndex++) { CXTPDatePickerItemDay* pDay = GetDay(nIndex); pDay->Draw(pDC); } // draw week numbers pPaintManager->DrawWeekNumbers(pDC, this); }
CXTPDatePickerItemDay* CXTPDatePickerItemMonth::GetDay(int nIndex) const { if (nIndex < GetDayCount()) return m_arrDays[nIndex]; return NULL; }