コード例 #1
0
BOOL CXTPCalendarWeekViewDay::OnLButtonDown(UINT nFlags, CPoint point)
{
	if (!GetView() || !GetCalendarControl())
	{
		ASSERT(FALSE);
		return FALSE;
	}

	if (GetView()->GetTheme())
	{
		if (XTP_SAFE_GET4(GetView(), GetTheme(), GetWeekViewPart(), GetDayPart(),
			OnLButtonDown(this, nFlags, point), FALSE))
		{
			return TRUE;
		}
	}
	else if (m_Layout.m_rcExpandSign.PtInRect(point))
	{
		if (UserAction_OnExpandDay(xtpCalendarExpandDayButton_WeekView))
			return TRUE;

		XTP_SAFE_CALL1(GetCalendarControl(), QueueDayViewSwitch(GetDayDate()));
		return TRUE;
	}

	return TBase::OnLButtonDown(nFlags, point);
}
コード例 #2
0
void CXTPCalendarWeekView::Draw(CDC* pDC)
{
	XTP_SAFE_CALL2(GetPaintManager(), GetWeekViewPart(), OnDraw(pDC, this));

	// Draw events

	int nDays = m_arDays.GetCount();
	for (int nDay = 0; nDay < nDays; nDay++)
	{
		XTP_SAFE_CALL1(m_arDays.GetAt(nDay), Draw(pDC));
	}
}
コード例 #3
0
void CXTPCalendarWeekView::AdjustLayout2(CDC* pDC, const CRect& rcView, BOOL bCallPostAdjustLayout)
{
	if (!GetTheme())
	{
		ASSERT(FALSE);
		return;
	}
	TBase::AdjustLayout(pDC, rcView, FALSE);
	AdjustFirstDayOfWeek();

	XTP_SAFE_CALL2(GetTheme(), GetWeekViewPart(), AdjustLayout(pDC, rcView, bCallPostAdjustLayout));
}
コード例 #4
0
CRect CXTPCalendarWeekViewDay::GetDayEventsRect() const
{
	int nColHeaderHeight = XTP_SAFE_GET1(GetView(), GetRowHeight(), 0);
	CRect rcDayEvents = m_Layout.m_rcDay;
	//rcDayEvents.bottom -= min(2, rcDayEvents.Height());
	rcDayEvents.top += min(nColHeaderHeight + 0, rcDayEvents.Height());
	int nBotSpace = XTP_SAFE_GET5(GetView(), GetCalendarControl(), GetTheme(),
		GetWeekViewPart(), GetDayPart(), GetExpandButtonHeight(), 0);

	rcDayEvents.bottom -= min(nBotSpace + 2, rcDayEvents.Height());


	return rcDayEvents;
}
コード例 #5
0
BOOL CXTPCalendarWeekViewDay::HitTestEx(CPoint pt, XTP_CALENDAR_HITTESTINFO_WEEK_VIEW* pHitTest)
{
	if (!pHitTest) {
		ASSERT(FALSE);
		return FALSE;
	}

	if (m_Layout.m_rcExpandSign.PtInRect(pt))
	{
		if (XTP_SAFE_GET4(GetView(), GetTheme(), GetWeekViewPart(), GetDayPart(),
			HitTestExpandDayButton(this, &pt), 0))
		{
			FillHitTestEx(pHitTest);
			pHitTest->uHitCode = xtpCalendarHitTestDayExpandButton;
			return TRUE;
		}
	}

	return TBase::HitTestEx(pt, pHitTest);
}
コード例 #6
0
void CXTPCalendarWeekViewDay::AdjustLayout2(CDC* pDC, const CRect& rcDay)
{
	TBase::AdjustLayout(pDC, rcDay);

	XTP_SAFE_CALL4(GetView(), GetTheme(), GetWeekViewPart(), GetDayPart(), AdjustLayout(this, pDC, rcDay));
}