分类: C/C++
2008-09-14 20:10:37
This control class CPieChartCtrl
is derived from CWnd
. The purpose is to create a simple 2D pie chart in a dialog. The code is created and compiled with Visual C++ 5.0 SP3 under Windows 98.
PIE_CHART_CTRL
" as the Class name.CPieChartCtrl
class member in the header file #include "PieChartCtrl.h" ... CPieChartCtrl m_wndChart;
InitDialog()
m_wndChart.SubclassDlgItem(IDC_PIECHART1, this); //IDC_PIECHART1 is the control ID
// SetTitle(CString) - Set the chart title text m_wndChart.SetTitle("Chart Title"); // Reset() - Reset the chart and delete all pieces m_wndChart.Reset(); // AddPiece(COLORREF colorBack, COLORREF colorText, // int nAngle, int strInfo = ""); // Add one piece into the chart m_wndChart.AddPiece(colorBack, colorText, nAngle, strInfo);