Exemple #1
0
//********************************************************************************
void CBCGPTreeMapGroup::OnDraw(CBCGPGraphicsManager* pGM, const CBCGPRect& rectClip, const CBCGPBrush& brBorder)
{
	ASSERT_VALID(pGM);

	if (m_rect.IsRectEmpty())
	{
		return;
	}

	CBCGPRect rectInter;
	if (!rectInter.IntersectRect(m_rect, rectClip))
	{
		return;
	}

	if (!m_rectCaption.IsRectEmpty())
	{
		pGM->FillRectangle(m_rectCaption, m_brFillCaption);
		DrawTextWidthShadow(pGM, m_strLabel, m_rectCaption, m_brText, m_tf);
	}

	int nSubNodes = (int)m_arSubNodes.GetSize();
	for (int i = 0; i < nSubNodes; i++)
	{
		m_arSubNodes[i]->OnDraw(pGM, rectClip, brBorder);
	}
}
Exemple #2
0
//****************************************************************************
void CBCGPTreeMapNode::OnDraw(CBCGPGraphicsManager* pGM, const CBCGPRect& rectClip, const CBCGPBrush& brBorder)
{
	ASSERT_VALID(pGM);

	if (m_rect.IsRectEmpty())
	{
		return;
	}

	CBCGPRect rectInter;
	if (!rectInter.IntersectRect(m_rect, rectClip))
	{
		return;
	}

	pGM->FillRectangle(m_rect, m_brFill);

	if (!m_strLabel.IsEmpty())
	{
		CBCGPTreeMapGroup* pGroup = DYNAMIC_DOWNCAST(CBCGPTreeMapGroup, m_pParent);
		if (pGroup != NULL)
		{
			ASSERT_VALID(pGroup);
			DrawTextWidthShadow(pGM, m_strLabel, m_rect, pGroup->m_brText, pGroup->m_tf);
		}
	}

	if (m_pParent != NULL)
	{
		ASSERT_VALID(m_pParent);

		if (m_pParent->GetRect().top != m_rect.top)
		{
			pGM->DrawLine(m_rect.left, m_rect.top, m_rect.right, m_rect.top, brBorder);
		}

		if (m_pParent->GetRect().bottom != m_rect.bottom)
		{
			pGM->DrawLine(m_rect.left, m_rect.bottom + 1, m_rect.right, m_rect.bottom + 1, brBorder);
		}

		if (m_pParent->GetRect().left != m_rect.left)
		{
			pGM->DrawLine(m_rect.left, m_rect.top, m_rect.left, m_rect.bottom, brBorder);
		}

		if (m_pParent->GetRect().right != m_rect.right)
		{
			pGM->DrawLine(m_rect.right + 1, m_rect.top, m_rect.right + 1, m_rect.bottom, brBorder);
		}
	}
}
//*******************************************************************************
CBCGPRect CBCGPChartObject::OnCalcBoundingRect()
{
	if (m_pXAxis == NULL && m_pYAxis == NULL || m_coordinateMode == CM_AXIS_OUTSIDE_MARK || m_coordinateMode == CM_AXIS_INSIDE_MARK ||
		m_pXAxis != NULL && !m_pXAxis->m_bInitialized)
	{
		return m_pParentChart->GetRect();
	}

	CBCGPRect rectXAxis;
	CBCGPRect rectYAxis;

	if (m_pXAxis != NULL)
	{
		rectXAxis = m_pXAxis->GetBoundingRect();
	}

	if (m_pYAxis != NULL)
	{
		rectYAxis = m_pYAxis->GetBoundingRect();
	}

	if (!rectXAxis.IsRectEmpty() && !rectYAxis.IsRectEmpty())
	{
		rectXAxis.IntersectRect(rectYAxis);
		if (rectXAxis.IsRectEmpty())
		{
			return rectYAxis;
		}
	}
	else if (rectXAxis.IsRectEmpty())
	{
		return rectYAxis;
	}

	return rectXAxis;
}