예제 #1
0
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();
}
예제 #3
0
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 ();
	}
}
예제 #5
0
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;
}
예제 #6
0
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;
}