Exemple #1
0
float CVar::GetFloat()
{
	if (m_bDirtyValues)
		CalculateValues();

	return m_flValue;
}
Exemple #2
0
bool CVar::GetBool()
{
	if (m_bDirtyValues)
		CalculateValues();

	return m_bValue;
}
Exemple #3
0
int CVar::GetInt()
{
	if (m_bDirtyValues)
		CalculateValues();

	return m_iValue;
}
void CXTPChartPyramidSeriesView::CalculatePointLayout(CXTPChartDeviceContext* pDC, CRect rcBounds)
{
	CXTPChartPyramidSeriesStyle* pStyle = STATIC_DOWNCAST(CXTPChartPyramidSeriesStyle, GetStyle());

	rcBounds.DeflateRect(5, 5, 5, 5);


	CXTPChartPyramidSeriesLabel* pLabel = (CXTPChartPyramidSeriesLabel*)pStyle->GetLabel();

	if (pLabel->IsVisible() && !pLabel->IsInside())
	{
		CSize sz(0, 0);
		for (int i = 0; i < m_pPointsView->GetCount(); i++)
		{
			CXTPChartPyramidSeriesPointView* pPointView = (CXTPChartPyramidSeriesPointView*)m_pPointsView->GetAt(i);

			CXTPChartString text(pLabel->GetPointLabel(pPointView->GetPoint()));
			CXTPChartTextPainter painter(pDC, text, pLabel);

			sz.cx = max(sz.cx, (INT)painter.GetSize().Width);
			sz.cy = max(sz.cy, (INT)painter.GetSize().Height);
		}

		int nLineLength = pStyle->GetLabel()->GetLineLength();
		if (pLabel->GetPosition() == xtpChartPyramidLabelRight)
			rcBounds.DeflateRect(0, 0, nLineLength + sz.cx, 0);
		if (pLabel->GetPosition() == xtpChartPyramidLabelLeft)
			rcBounds.DeflateRect(nLineLength + sz.cx, 0, 0, 0);
	}



	double dRatio = pStyle->GetHeightToWidthRatio();
	if (dRatio > CXTPChartMathUtils::m_dEPS)
	{
		int nHeight = rcBounds.Height();
		int nWidth = int(nHeight / dRatio);

		if (nWidth > rcBounds.Width())
		{
			nWidth = rcBounds.Width();
			nHeight = int(nWidth * dRatio);
		}

		CPoint ptTopLeft((rcBounds.left + rcBounds.right - nWidth) / 2, (rcBounds.top + rcBounds.bottom - nHeight) / 2);
		rcBounds = CRect(ptTopLeft, CSize(nWidth, nHeight));
	}


	m_rcInnterBounds = rcBounds;


	CalculateValues();

	int nCount = m_pPointsView->GetCount();

	double dFrom = 0;

	for (int i = 0; i < nCount; i++)
	{
		CXTPChartPyramidSeriesPointView* pPointView = (CXTPChartPyramidSeriesPointView*)m_pPointsView->GetAt(i);

		pPointView->CalculateLayout(i, nCount, dFrom, dFrom + pPointView->m_dValue);
		dFrom += pPointView->m_dValue;
	}
}