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

📄 cfxscroll.cpp

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

#include "stdafx.h"
#include "cfx98.h"
#include "CfxScroll.h"

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

/////////////////////////////////////////////////////////////////////////////
// CCfxScroll dialog


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


void CCfxScroll::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CCfxScroll)
		// 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_ChartFX1);
	DDX_Control(pDX, IDC_CHART2, m_ChartFX2);
	if (!pDX->m_bSaveAndValidate) { // Link Chart FX pointer to control window
		m_pChartFX1 = m_ChartFX1.GetControlUnknown();
		m_pChartFX2 = m_ChartFX2.GetControlUnknown();
	}
	// ***CFX***

}


BEGIN_MESSAGE_MAP(CCfxScroll, CDialog)
	//{{AFX_MSG_MAP(CCfxScroll)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CCfxScroll message handlers

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

	return CDialog::DestroyWindow();
}

BOOL CCfxScroll::OnInitDialog() 
{
	CDialog::OnInitDialog();
	
	// TODO: Add extra initialization here
	// Turn OFF scroll bars for the chart on top but KEEP scrolling functionallity
    m_pChartFX1->Style = (CfxStyle) (m_pChartFX1->Style & ~CS_SCROLLBARS);
    
    // Faster but restricted scrolling
    m_pChartFX1->TypeMask = (CfxType) (m_pChartFX1->TypeMask | CT_EVENSPACING);
    m_pChartFX2->TypeMask = (CfxType) (m_pChartFX2->TypeMask | CT_EVENSPACING);
    
    // Align
    m_pChartFX1->LeftGap = m_pChartFX2->LeftGap;
    m_pChartFX1->Axis->Item[AXIS_X]->Style = (CfxAxisStyle) (m_pChartFX1->Axis->Item[AXIS_X]->Style | AS_HIDETEXT);
    m_pChartFX1->BottomGap = 10;
    m_pChartFX2->TopGap = 10;
    m_pChartFX1->Grid = CHART_BOTHGRID;
    m_pChartFX2->Grid = CHART_BOTHGRID;

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

BEGIN_EVENTSINK_MAP(CCfxScroll, CDialog)
    //{{AFX_EVENTSINK_MAP(CCfxScroll)
	ON_EVENT(CCfxScroll, IDC_CHART2, 15 /* UserScroll */, OnUserScrollChart2, VTS_I4 VTS_I4 VTS_PI2)
	//}}AFX_EVENTSINK_MAP
END_EVENTSINK_MAP()

void CCfxScroll::OnUserScrollChart2(long wScrollMsg, long wScrollParam, short FAR* nRes) 
{
	// TODO: Add your control notification handler code here
    m_pChartFX1->Scroll((CfxScroll) MAKELONG(wScrollMsg, wScrollParam),0);

	
}

⌨️ 快捷键说明

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