📄 cfxcolor.cpp
字号:
// CfxColor.cpp : implementation file
//
#include "stdafx.h"
#include "Cfx98.h"
#include "CfxColor.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CCfxColor dialog
CCfxColor::CCfxColor(CWnd* pParent /*=NULL*/)
: CDialog(CCfxColor::IDD, pParent)
{
//{{AFX_DATA_INIT(CCfxColor)
// NOTE: the ClassWizard will add member initialization here
//}}AFX_DATA_INIT
}
void CCfxColor::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CCfxColor)
// NOTE: the ClassWizard will add DDX and DDV calls here
//}}AFX_DATA_MAP
// ***CFX***
// Do not use class wizard to generate these. It will cause the generation of unecesary classes
DDX_Control(pDX, IDC_CHART1, m_ChartFX);
if (!pDX->m_bSaveAndValidate) // Link Chart FX pointer to control window
m_pChartFX = m_ChartFX.GetControlUnknown();
// ***CFX***
}
BEGIN_MESSAGE_MAP(CCfxColor, CDialog)
//{{AFX_MSG_MAP(CCfxColor)
ON_BN_CLICKED(IDC_SERIESCOLOR, OnSeriescolor)
ON_BN_CLICKED(IDC_TEXTCOLOR, OnTextcolor)
ON_BN_CLICKED(IDC_BKGNDCOLOR, OnBkgndcolor)
ON_BN_CLICKED(IDC_POINTLABELS, OnPointlabels)
ON_BN_CLICKED(IDC_MULTIPLECOLOR, OnMultiplecolor)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CCfxColor message handlers
BOOL CCfxColor::DestroyWindow()
{
m_pChartFX = NULL;
return CDialog::DestroyWindow();
}
void CCfxColor::OnSeriescolor()
{
// TODO: Add your control notification handler code here
m_pChartFX->OpenDataEx(COD_COLORS, 2, 0);
m_pChartFX->Series->Item[0]->Color = RGB(128, 128, 0);
m_pChartFX->Series->Item[1]->Color = RGB(200, 200, 128);
m_pChartFX->CloseData(COD_COLORS);
}
void CCfxColor::OnTextcolor()
{
// TODO: Add your control notification handler code here
ICfxAxisPtr pAxis;
pAxis = m_pChartFX->Axis->Item[AXIS_Y];
pAxis->TextColor = RGB(100, 100, 0);
pAxis->FontMask = (CfxFontAttr) (pAxis->FontMask | CF_COURIERNEW | CF_ITALIC | 10);
pAxis->TitleColor = RGB(100, 100, 0);
pAxis->TitleFontMask = (CfxFontAttr) (pAxis->TitleFontMask | CF_TIMESNEWR | CF_ITALIC | 14);
pAxis = m_pChartFX->Axis->Item[AXIS_X];
pAxis->TextColor = RGB(100, 100, 0);
pAxis->FontMask = (CfxFontAttr) (pAxis->FontMask | CF_COURIERNEW | CF_ITALIC | 10);
pAxis->TitleColor = RGB(100, 100, 0);
pAxis->TitleFontMask = (CfxFontAttr) (pAxis->TitleFontMask | CF_TIMESNEWR | CF_ITALIC | 14);
m_pChartFX->RGBFont[(CfxFont) CHART_TOPTIT] = RGB(100, 100, 0);
m_pChartFX->Fonts[(CfxFont) CHART_TOPTIT] = (CfxFontAttr) (CF_TIMESNEWR | CF_ITALIC | CF_BOLD | 18);
}
void CCfxColor::OnBkgndcolor()
{
// TODO: Add your control notification handler code here
m_pChartFX->RGBBk = RGB(200, 200, 200);
m_pChartFX->RGB3DBk = RGB(100, 200, 175);
}
void CCfxColor::OnPointlabels()
{
// TODO: Add your control notification handler code here
ICfxSeriesPtr pSerie;
pSerie = m_pChartFX->Series->Item[1];
pSerie->PointLabels = TRUE;
pSerie->PointLabelAlign = (CfxAlign) (LA_RIGHT | LA_BASELINE);
pSerie->PointLabelAngle = -45;
m_pChartFX->RGBFont[(CfxFont) CHART_VALUESFT] = RGB(255, 255, 255);
m_pChartFX->Fonts[(CfxFont) CHART_VALUESFT] = (CfxFontAttr) (CF_COURIERNEW | CF_BOLD | CF_ITALIC | 10);
}
void CCfxColor::OnMultiplecolor()
{
// TODO: Add your control notification handler code here
int j;
m_pChartFX->MultipleColors = TRUE;
m_pChartFX->OpenDataEx(COD_COLORS, 20, 0);
for (j=0; j<9; j++) {
m_pChartFX->Color[j * 2] = RGB(128, 128, 0);
m_pChartFX->Color[1 + j * 2] = RGB(100 + 10 * j, 150 + 20 * j, 50 * 10 * j);
}
m_pChartFX->CloseData(COD_COLORS);
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -