📄 legendwnd.cpp
字号:
return m_wndLegendText;
}
/************************************************************************************************/
/* */
/* Function: CLegendWnd::AddPointItem() */
/* */
/* Purpose : adds a legend item to the m_PointArray pointer list */
/* */
/* Inputs : CString& Caption -> the caption for this item */
/* COLORREF Color -> the color for this item */
/* */
/* Outputs : NONE */
/* */
/* Author : Scott Pelger Date Created: 15MAY02 */
/* */
/* Revisions */
/* */
/* Engineer Date Description */
/* */
/* Scott Pelger 15MAY02 initial version */
/* */
/************************************************************************************************/
void CLegendWnd::AddPointItem(CString& Caption, COLORREF Color) {
m_PointArray.Add(_CreateNewLegendItem(Caption, Color));
return;
}
/************************************************************************************************/
/* */
/* Function: CLegendWnd::RemovePointItem() */
/* */
/* Purpose : removes a legend item to the m_PointArray pointer list */
/* */
/* Inputs : int nItem -> the item to remove */
/* */
/* Outputs : NONE */
/* */
/* Author : Scott Pelger Date Created: 15MAY02 */
/* */
/* Revisions */
/* */
/* Engineer Date Description */
/* */
/* Scott Pelger 15MAY02 initial version */
/* */
/************************************************************************************************/
void CLegendWnd::RemovePointItem(int nItem) {
CLegendText* pWnd = (CLegendText*)m_PointArray.GetAt(nItem);
pWnd->DestroyWindow();
delete pWnd;
m_PointArray.RemoveAt(nItem);
return;
}
/************************************************************************************************/
/* */
/* Function: CLegendWnd::AddSeriesItem() */
/* */
/* Purpose : adds a legend item to the m_SeriesArray pointer list */
/* */
/* Inputs : CString& Caption -> the caption for this item */
/* COLORREF Color -> the color for this item */
/* */
/* Outputs : NONE */
/* */
/* Author : Scott Pelger Date Created: 15MAY02 */
/* */
/* Revisions */
/* */
/* Engineer Date Description */
/* */
/* Scott Pelger 15MAY02 initial version */
/* */
/************************************************************************************************/
void CLegendWnd::AddSeriesItem(CString& Caption, COLORREF Color) {
m_SeriesArray.Add(_CreateNewLegendItem(Caption, Color));
return;
}
/************************************************************************************************/
/* */
/* Function: CLegendWnd::AddSeriesItem() */
/* */
/* Purpose : removes a legend item to the m_SeriesArray pointer list */
/* */
/* Inputs : int nItem -> the item to remove */
/* */
/* Outputs : NONE */
/* */
/* Author : Scott Pelger Date Created: 15MAY02 */
/* */
/* Revisions */
/* */
/* Engineer Date Description */
/* */
/* Scott Pelger 15MAY02 initial version */
/* */
/************************************************************************************************/
void CLegendWnd::RemoveSeriesItem(int nItem) {
CLegendText* pWnd = (CLegendText*)m_SeriesArray.GetAt(nItem);
pWnd->DestroyWindow();
delete pWnd;
m_SeriesArray.RemoveAt(nItem);
return;
}
/************************************************************************************************/
/* */
/* Function: CLegendWnd::Purge() */
/* */
/* Purpose : removes all legend items from both legend arrays */
/* */
/* Inputs : NONE */
/* */
/* Outputs : NONE */
/* */
/* Author : Scott Pelger Date Created: 15MAY02 */
/* */
/* Revisions */
/* */
/* Engineer Date Description */
/* */
/* Scott Pelger 15MAY02 initial version */
/* */
/************************************************************************************************/
void CLegendWnd::Purge() {
int nCnt(m_PointArray.GetSize());
CLegendText* pWnd;
for (int i(0);i<nCnt;i++) {
pWnd = (CLegendText*)m_PointArray.GetAt(i);
pWnd->DestroyWindow();
delete pWnd;
}
m_PointArray.RemoveAll();
nCnt = m_SeriesArray.GetSize();
for (i=0;i<nCnt;i++) {
pWnd = (CLegendText*)m_SeriesArray.GetAt(i);
pWnd->DestroyWindow();
delete pWnd;
}
m_SeriesArray.RemoveAll();
return;
}
/************************************************************************************************/
/* */
/* Function: CLegendWnd::_GetLegendList() */
/* */
/* Purpose : returns the specified legend list */
/* */
/* Inputs : NONE */
/* */
/* Outputs : CPtrArray* <- the desired legend list */
/* */
/* Author : Scott Pelger Date Created: 17MAY02 */
/* */
/* Revisions */
/* */
/* Engineer Date Description */
/* */
/* Scott Pelger 17MAY02 initial version */
/* */
/************************************************************************************************/
CPtrArray* CLegendWnd::_GetLegendList() {
if (m_bShowPointLegend)
return &m_PointArray;
else
return &m_SeriesArray;
return NULL;
}
//***********************************************************************************************
// END OF FILE
// $Log: LegendWnd.cpp,v $
// Revision 1.4 2002/09/10 06:44:35 peter
// 没有GDI资源泄漏了
//
// Revision 1.3 2002/09/09 05:10:11 peter
// 修改全是0之后会死的bug,GDI资源漏洞依然存在
//
// Revision 1.2 2002/09/08 03:42:36 peter
// 可以在98下面用了,chart 当所有值都是0的时候有问题
//
// Revision 1.1 2002/09/07 06:03:54 peter
// 新的chart类,从别的地方拷来的
//
//***********************************************************************************************
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -