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 CBCGPPlannerViewMulti::OnPaint (CDC* pDC, const CRect& rectClient)
{
	ASSERT_VALID (pDC);

	OnDrawClient (pDC, m_rectApps);

	OnDrawAppointmentsDuration (pDC);

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

		OnDrawHeaderAllDay (pDC, rtHeader);

		CRgn rgn;
		rgn.CreateRectRgn (rtHeader.left, rtHeader.top, rtHeader.right, rtHeader.bottom);

		pDC->SelectClipRgn (&rgn);

		OnDrawAppointments (pDC, rtHeader);

		pDC->SelectClipRgn (NULL);
	}

	{
		CRgn rgn;
		rgn.CreateRectRgn (m_rectApps.left, m_rectApps.top, m_rectApps.right, m_rectApps.bottom);

		pDC->SelectClipRgn (&rgn);
		
		OnDrawAppointments (pDC, m_rectApps);

		pDC->SelectClipRgn (NULL);
	}

	if (!m_rectTimeBar.IsRectEmpty ())
	{
		OnDrawTimeBar (pDC, m_rectTimeBar, IsCurrentTimeVisible ());
	}

	OnDrawUpDownIcons (pDC);

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

		OnDrawHeader (pDC, rtHeader);

		rtHeader.top = rtHeader.bottom;
		rtHeader.bottom = rtHeader.top + m_nHeaderHeight / 2;

		OnDrawHeaderResource (pDC, rtHeader);
	}

	InitToolTipInfo ();
}
Exemplo n.º 3
0
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);
	}
}