void CBCGPPlannerViewMonth::OnPaint (CDC* pDC, const CRect& rectClient)
{
	ASSERT_VALID (pDC);

	if (m_nWeekBarWidth != 0)
	{
		CRect rtBar (rectClient);
		rtBar.right  = rtBar.left + m_nWeekBarWidth;

		OnDrawWeekBar (pDC, rtBar);
	}

	OnDrawClient (pDC, m_rectApps);

	if (m_nHeaderHeight != 0)
	{
		CRect rtHeader (rectClient);
		rtHeader.left   = m_rectApps.left;
		rtHeader.bottom = rtHeader.top + m_nHeaderHeight;

		OnDrawHeader (pDC, rtHeader);
	}

	OnDrawAppointments (pDC);

	OnDrawUpDownIcons (pDC);

	InitToolTipInfo ();
}
void CBCGPPlannerPrintMonth::OnPaint (CDC* pDC, CPrintInfo* pInfo)
{
	ASSERT_VALID (pDC);
	ASSERT (pInfo != NULL);

	CBCGPPlannerPrint::OnPaint (pDC, pInfo);

	int nOldBk = pDC->SetBkMode (TRANSPARENT);

	if (m_nWeekBarWidth != 0)
	{
		CRect rtBar (m_rectApps);
		rtBar.left -= m_nWeekBarWidth;
		rtBar.right = rtBar.left + m_nWeekBarWidth;

		OnDrawWeekBar (pDC, rtBar);
	}

	CFont* pOldFont = pDC->SelectObject (&m_Font);

	OnDrawClient (pDC);

	CRect rtFrame (m_rectApps);

	if (m_nHeaderHeight != 0)
	{
		CRect rtHeader (m_rectApps);
		rtHeader.top    -= m_nHeaderHeight;
		rtHeader.bottom = rtHeader.top + m_nHeaderHeight;

		OnDrawHeader (pDC, rtHeader);

		rtFrame.top = rtHeader.top;
	}

	OnDrawAppointments (pDC);

	pDC->SelectObject (pOldFont);
	pDC->SetBkMode (nOldBk);

	{
		CRect rect (rtFrame);
		rect.InflateRect (m_OnePoint.cx, m_OnePoint.cy);

		HBRUSH hOldBrush = (HBRUSH)::SelectObject (pDC->GetSafeHdc (), ::GetStockObject (NULL_BRUSH));
		CPen* pOldPen = (CPen*)pDC->SelectObject (&m_penBlack);

		pDC->Rectangle (rect);

		::SelectObject (pDC->GetSafeHdc (), hOldBrush);
		pDC->SelectObject (pOldPen);
	}
}