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

📄 cfxscrollzoom.cpp

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

#include "stdafx.h"
#include "cfx98.h"
#include "CfxScrollZoom.h"

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

/////////////////////////////////////////////////////////////////////////////
// CCfxScrollZoom dialog


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


void CCfxScrollZoom::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CCfxScrollZoom)
		// 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(CCfxScrollZoom, CDialog)
	//{{AFX_MSG_MAP(CCfxScrollZoom)
	ON_BN_CLICKED(IDC_APPLY, OnApply)
	ON_BN_CLICKED(IDC_ZOOMIN, OnZoomin)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CCfxScrollZoom message handlers

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

void CCfxScrollZoom::OnApply() 
{
	// TODO: Add your control notification handler code here
	int x1,x2;
	BOOL t;

	x1 = GetDlgItemInt(IDC_FROMX, &t, TRUE);
	x2 = GetDlgItemInt(IDC_TOX, &t, TRUE);
	m_pChartFX->Axis->Item[AXIS_X]->SetScrollView(x1,x2);
	
}

void CCfxScrollZoom::OnZoomin() 
{

	// TODO: Add your control notification handler code here
	int x1,y1,x2,y2;
	BOOL t;

	x1 = GetDlgItemInt(IDC_FROMXZOOM, &t, TRUE);
	y1 = GetDlgItemInt(IDC_FROMYZOOM, &t, TRUE);
	x2 = GetDlgItemInt(IDC_TOXZOOM, &t, TRUE);
	y2 = GetDlgItemInt(IDC_TOYZOOM, &t, TRUE);

    if (IsDlgButtonChecked(IDC_ZOOMIN))
        m_pChartFX->ZoomIn(x1,y1,x2,y2); 
    else
        m_pChartFX->Zoom = FALSE;
    

	
}

BOOL CCfxScrollZoom::OnInitDialog() 
{
	int i;

	CDialog::OnInitDialog();
	
	// TODO: Add extra initialization here
	SetDlgItemText(IDC_FROMX, "11");
	SetDlgItemText(IDC_TOX, "30");
    
	SetDlgItemText(IDC_FROMXZOOM, "31");
	SetDlgItemText(IDC_FROMYZOOM, "600");
	SetDlgItemText(IDC_TOXZOOM, "40");
	SetDlgItemText(IDC_TOYZOOM, "1800");
    
    
    m_pChartFX->OpenDataEx(COD_VALUES, 1, COD_UNCHANGE);
        
	for(i=0;i<m_pChartFX->NValues;i++) 
		m_pChartFX->ValueEx[0][i] = i * i;

        
	m_pChartFX->CloseData(COD_VALUES);
    

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

⌨️ 快捷键说明

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