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

📄 cfxsurfacecontour.cpp

📁 Delphi Component - Chart Fx
💻 CPP
字号:
// CfxSurfaceContour.cpp : implementation file
//

#include "stdafx.h"
#include "cfx98.h"
#include "CfxSurfaceContour.h"
#include "math.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CCfxSurfaceContour dialog


CCfxSurfaceContour::CCfxSurfaceContour(CWnd* pParent /*=NULL*/)
	: CDialog(CCfxSurfaceContour::IDD, pParent)
{
	//{{AFX_DATA_INIT(CCfxSurfaceContour)
		// NOTE: the ClassWizard will add member initialization here
	//}}AFX_DATA_INIT
}


void CCfxSurfaceContour::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CCfxSurfaceContour)
		// 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(CCfxSurfaceContour, CDialog)
	//{{AFX_MSG_MAP(CCfxSurfaceContour)
	ON_BN_CLICKED(IDC_CONTOUR, OnContour)
	ON_BN_CLICKED(IDC_SURFACE, OnSurface)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CCfxSurfaceContour message handlers

BOOL CCfxSurfaceContour::DestroyWindow() 
{
	// TODO: Add your specialized code here and/or call the base class
	m_pChartFX = NULL;

	return CDialog::DestroyWindow();
}

BOOL CCfxSurfaceContour::OnInitDialog() 
{
	CDialog::OnInitDialog();
	
	// TODO: Add extra initialization here
    int i,j;
	char buffer[20];
	
    
    m_pChartFX->Axis->Item[AXIS_Y]->ResetScale();
        
    //Set smooth data
    m_pChartFX->OpenDataEx(COD_VALUES, 20, 20);
    for(i=0;i<20;i++) {
		if (i % 2 == 0) {
			itoa(i, buffer, 10);
			m_pChartFX->KeySer[i] = buffer;
		}            
		for(j=0;j<20;j++) {
			m_pChartFX->ValueEx[i][j] = (sin((i * 2 * 3.1416) / 19) * cos(((j + 5) * 2 * 3.1416) / 19)) * 100;
		}
	}
    m_pChartFX->CloseData(COD_VALUES);
        
    m_pChartFX->Axis->Item[AXIS_Y]->Decimals = 0;
        
    // 3D Settings
	m_pChartFX->View3D = TRUE;
    m_pChartFX->View3DDepth = 60;
    m_pChartFX->AngleX = 30;
    m_pChartFX->AngleY = 45;
	m_pChartFX->Perspective = 50;

        
    //Constrains
    m_pChartFX->ShowTips = FALSE;
    m_pChartFX->AllowDrag = FALSE;
        
    m_pChartFX->SerLegBoxObj->BorderStyle = BBS_NONE;
    
                

	
	return TRUE;  // return TRUE unless you set the focus to a control
	              // EXCEPTION: OCX Property Pages should return FALSE
}

void CCfxSurfaceContour::OnContour() 
{
 
	m_pChartFX->LeftGap = 0;
    m_pChartFX->RightGap = 20;
    m_pChartFX->TopGap = 0;
    m_pChartFX->BottomGap = 20;
        
    m_pChartFX->Gallery = CONTOUR;
    m_pChartFX->SetContourLabels(20);
    m_pChartFX->SerLegBoxObj->Docked = TGFP_RIGHT;
        
    m_pChartFX->Axis->Item[AXIS_Y]->Style = (CfxAxisStyle) (m_pChartFX->Axis->Item[AXIS_Y]->Style & ~AS_BREAKZERO);
	m_pChartFX->RGB3DBk = CHART_TRANSPARENT;    //No background
    
	
	
}

void CCfxSurfaceContour::OnSurface() 
{

	m_pChartFX->LeftGap = 30;
    m_pChartFX->RightGap = 10;
    m_pChartFX->TopGap = 10;
    m_pChartFX->BottomGap = 20;
        
    m_pChartFX->Gallery = SURFACE;
    m_pChartFX->SetContourLabels(20);
    m_pChartFX->SerLegBoxObj->Docked = TGFP_BOTTOM;
        
    m_pChartFX->Axis->Item[AXIS_Y]->Style = (CfxAxisStyle) (m_pChartFX->Axis->Item[AXIS_Y]->Style | AS_BREAKZERO);
    m_pChartFX->RGB3DBk = CHART_PALETTECOLOR | 0;  // Standard background
    
	
	
}

⌨️ 快捷键说明

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