⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 legendwnd.cpp

📁 The application wizard has created this SoccerDoctor application for you. This application not onl
💻 CPP
📖 第 1 页 / 共 4 页
字号:
    
    for (i=0;i<nCnt;i++) {
        pWnd = (CLegendText*)m_SeriesArray.GetAt(i);
        pWnd->SetBackgroundColor(Color);
        }

    return CChartWndBase::SetWindowColor(Color);
    }

/************************************************************************************************/
/*                                                                                              */
/* Function: CLegendWnd::SetLegendTextColor()                                                   */
/*                                                                                              */
/* Purpose : sets the legend text color                                                         */
/*                                                                                              */
/* Inputs  : COLORREF Color -> sets the color of the legend text                                */
/*                                                                                              */
/* Outputs : NONE                                                                               */
/*                                                                                              */
/* Author  : Scott Pelger                                             Date Created: 11JUN02     */
/*                                                                                              */
/* Revisions                                                                                    */
/*                                                                                              */
/* Engineer              Date        Description                                                */
/*                                                                                              */
/* Scott Pelger          11JUN02     initial version                                            */
/*                                                                                              */
/************************************************************************************************/
void CLegendWnd::SetLegendTextColor(COLORREF Color) {

    m_crTextColor = Color;

    int nCnt(m_PointArray.GetSize());

    CLegendText* pWnd;
    for (int i(0);i<nCnt;i++) {
        pWnd = (CLegendText*)m_PointArray.GetAt(i);
        pWnd->SetTextColor(Color);
        }

    nCnt = m_SeriesArray.GetSize();
    
    for (i=0;i<nCnt;i++) {
        pWnd = (CLegendText*)m_SeriesArray.GetAt(i);
        pWnd->SetTextColor(Color);
        }

    return;
    }

/************************************************************************************************/
/*                                                                                              */
/* Function: CLegendWnd::SetLegendSeriesItemColor()                                             */
/*                                                                                              */
/* Purpose : sets the legend series item color                                                  */
/*                                                                                              */
/* Inputs  : COLORREF Color -> sets the color of the legend item                                */
/*           int nDataSeries -> the data series whose color is to be set                        */
/*                                                                                              */
/* Outputs : NONE                                                                               */
/*                                                                                              */
/* Author  : Scott Pelger                                             Date Created: 28JUN02     */
/*                                                                                              */
/* Revisions                                                                                    */
/*                                                                                              */
/* Engineer              Date        Description                                                */
/*                                                                                              */
/* Scott Pelger          28JUN02     initial version                                            */
/*                                                                                              */
/************************************************************************************************/
void CLegendWnd::SetLegendSeriesItemColor(COLORREF Color, int nDataSeries/*=0*/) {

    int nCnt(m_SeriesArray.GetSize());

    if (nDataSeries+1>nCnt)
        return;

    CLegendText* pWnd = (CLegendText*)m_SeriesArray.GetAt(nDataSeries);
    pWnd->SetItemColor(Color);

    return;
    }

/************************************************************************************************/
/*                                                                                              */
/* Function: CLegendWnd::GetLegendSeriesItemColor()                                             */
/*                                                                                              */
/* Purpose : gets the legend series item color                                                  */
/*                                                                                              */
/* Inputs  : int nDataSeries -> the data series whose color is to be retrieved                  */
/*                                                                                              */
/* Outputs : NONE                                                                               */
/*                                                                                              */
/* Author  : Scott Pelger                                             Date Created: 28JUN02     */
/*                                                                                              */
/* Revisions                                                                                    */
/*                                                                                              */
/* Engineer              Date        Description                                                */
/*                                                                                              */
/* Scott Pelger          28JUN02     initial version                                            */
/*                                                                                              */
/************************************************************************************************/
COLORREF CLegendWnd::GetLegendSeriesItemColor(int nDataSeries/*=0*/) {

    int nCnt(m_SeriesArray.GetSize());

    if (nDataSeries+1>nCnt)
        return 0;

    CLegendText* pWnd = (CLegendText*)m_SeriesArray.GetAt(nDataSeries);
    
    return pWnd->GetItemColor();
    }

/************************************************************************************************/
/*                                                                                              */
/* Function: CLegendWnd::SetLegendPointItemColor()                                              */
/*                                                                                              */
/* Purpose : sets the legend point item color                                                   */
/*                                                                                              */
/* Inputs  : COLORREF Color -> sets the color of the legend item                                */
/*           int nDataPoint -> the data series whose color is to be set                         */
/*                                                                                              */
/* Outputs : NONE                                                                               */
/*                                                                                              */
/* Author  : Scott Pelger                                             Date Created: 28JUN02     */
/*                                                                                              */
/* Revisions                                                                                    */
/*                                                                                              */
/* Engineer              Date        Description                                                */
/*                                                                                              */
/* Scott Pelger          28JUN02     initial version                                            */
/*                                                                                              */
/************************************************************************************************/
void CLegendWnd::SetLegendPointItemColor(COLORREF Color, int nDataPoint/*=0*/) {

    int nCnt(m_PointArray.GetSize());

    if (nDataPoint+1>nCnt)
        return;

    CLegendText* pWnd = (CLegendText*)m_PointArray.GetAt(nDataPoint);
    pWnd->SetItemColor(Color);

    return;
    }

/************************************************************************************************/
/*                                                                                              */
/* Function: CLegendWnd::GetLegendPointItemColor()                                              */
/*                                                                                              */
/* Purpose : gets the legend point item color                                                   */
/*                                                                                              */
/* Inputs  : int nDataPoint -> the data point whose color is to be retrieved                    */
/*                                                                                              */
/* Outputs : NONE                                                                               */
/*                                                                                              */
/* Author  : Scott Pelger                                             Date Created: 28JUN02     */
/*                                                                                              */
/* Revisions                                                                                    */
/*                                                                                              */
/* Engineer              Date        Description                                                */
/*                                                                                              */
/* Scott Pelger          28JUN02     initial version                                            */
/*                                                                                              */
/************************************************************************************************/
COLORREF CLegendWnd::GetLegendPointItemColor(int nDataPoint/*=0*/) {

    int nCnt(m_PointArray.GetSize());

    if (nDataPoint+1>nCnt)
        return 0;

    CLegendText* pWnd = (CLegendText*)m_PointArray.GetAt(nDataPoint);
    
    return pWnd->GetItemColor();
    }

/************************************************************************************************/
/*                                                                                              */
/* Function: CLegendWnd::_CreateNewLegendItem()                                                 */
/*                                                                                              */
/* Purpose : creates a new legend item                                                          */
/*                                                                                              */
/* Inputs  : CString& Caption -> the caption for this item                                      */
/*           COLORREF Color -> the color for this item                                          */
/*                                                                                              */
/* Outputs : CLegendText* <- pointer to the new legend item                                     */
/*                                                                                              */
/* Author  : Scott Pelger                                             Date Created: 15MAY02     */
/*                                                                                              */
/* Revisions                                                                                    */
/*                                                                                              */
/* Engineer              Date        Description                                                */
/*                                                                                              */
/* Scott Pelger          15MAY02     initial version                                            */
/*                                                                                              */
/************************************************************************************************/
CLegendText* CLegendWnd::_CreateNewLegendItem(CString& Caption, COLORREF Color) {

    CLegendText* m_wndLegendText = new CLegendText;
    
    m_wndLegendText->Create(Caption, WS_CHILD|WS_VISIBLE|SS_CENTER, CRect(0, 0, 0, 0), this);
    m_wndLegendText->SetFont(m_yPointSize, m_sFontName.GetBuffer(0));
    m_wndLegendText->SetBackgroundColor(m_crWindowColor);
    m_wndLegendText->SetBorderColor(m_crTextColor);
    m_wndLegendText->SetTextColor(m_crTextColor);
    m_wndLegendText->SetItemColor(Color);
    m_wndLegendText->SetItemStyle(SHP_SQUARE);

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -