📄 cfxuserinterface.cpp
字号:
// CfxUserInterface.cpp : implementation file
//
#include "stdafx.h"
#include "cfx98.h"
#include "CfxUserInterface.h"
#include "string.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CCfxUserInterface dialog
CCfxUserInterface::CCfxUserInterface(CWnd* pParent /*=NULL*/)
: CDialog(CCfxUserInterface::IDD, pParent)
{
//{{AFX_DATA_INIT(CCfxUserInterface)
// NOTE: the ClassWizard will add member initialization here
//}}AFX_DATA_INIT
}
void CCfxUserInterface::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CCfxUserInterface)
// 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(CCfxUserInterface, CDialog)
//{{AFX_MSG_MAP(CCfxUserInterface)
ON_BN_CLICKED(IDC_CUSTOMDOUBLECLK, OnCustomdoubleclk)
ON_BN_CLICKED(IDC_CUSTOMIZEDTIPS, OnCustomizedtips)
ON_BN_CLICKED(IDC_DRAGMARKERS, OnDragmarkers)
ON_BN_CLICKED(IDC_EDITDATAEDITOR, OnEditdataeditor)
ON_BN_CLICKED(IDC_MENUSONDEMAND, OnMenusondemand)
ON_BN_CLICKED(IDC_RESIZE, OnResize)
ON_BN_CLICKED(IDC_SCROLLABLE, OnScrollable)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CCfxUserInterface message handlers
BOOL CCfxUserInterface::DestroyWindow()
{
// TODO: Add your specialized code here and/or call the base class
m_pChartFX = NULL;
return CDialog::DestroyWindow();
}
void CCfxUserInterface::OnCustomdoubleclk()
{
if (IsDlgButtonChecked(IDC_CUSTOMDOUBLECLK))
m_pChartFX->DblClk(CHART_BALLOONCLK, 0);
else
m_pChartFX->DblClk(CHART_PROPERTIESCLK, 0);
}
void CCfxUserInterface::OnCustomizedtips()
{
if (IsDlgButtonChecked(IDC_CUSTOMIZEDTIPS))
m_pChartFX->ShowTips = TRUE;
else
m_pChartFX->ShowTips = FALSE;
}
void CCfxUserInterface::OnDragmarkers()
{
if (IsDlgButtonChecked(IDC_DRAGMARKERS))
m_pChartFX->AllowDrag = TRUE;
else
m_pChartFX->AllowDrag = FALSE;
}
void CCfxUserInterface::OnEditdataeditor()
{
if (IsDlgButtonChecked(IDC_EDITDATAEDITOR)) {
m_pChartFX->AllowEdit = TRUE;
m_pChartFX->DataEditor = TRUE;
} else
m_pChartFX->AllowEdit = FALSE;
}
void CCfxUserInterface::OnMenusondemand()
{
if (IsDlgButtonChecked(IDC_MENUSONDEMAND))
m_pChartFX->ContextMenus = TRUE;
else
m_pChartFX->ContextMenus = FALSE;
}
void CCfxUserInterface::OnResize()
{
if (IsDlgButtonChecked(IDC_RESIZE))
m_pChartFX->AllowResize = TRUE;
else
m_pChartFX->AllowResize = FALSE;
}
void CCfxUserInterface::OnScrollable()
{
if (IsDlgButtonChecked(IDC_SCROLLABLE))
m_pChartFX->Scrollable = TRUE;
else
m_pChartFX->Scrollable = FALSE;
}
BOOL CCfxUserInterface::OnInitDialog()
{
CDialog::OnInitDialog();
// TODO: Add extra initialization here
m_pChartFX->AllowDrag = FALSE;
m_pChartFX->AllowEdit = FALSE;
m_pChartFX->AllowResize = FALSE;
m_pChartFX->ContextMenus = FALSE;
m_pChartFX->ShowTips = FALSE;
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
BEGIN_EVENTSINK_MAP(CCfxUserInterface, CDialog)
//{{AFX_EVENTSINK_MAP(CCfxUserInterface)
ON_EVENT(CCfxUserInterface, IDC_CHART1, 31 /* GetTip */, OnGetTipChart1, VTS_I2 VTS_I4 VTS_I4 VTS_PI2)
ON_EVENT(CCfxUserInterface, IDC_CHART1, 1 /* LButtonDblClk */, OnLButtonDblClkChart1, VTS_I2 VTS_I2 VTS_I4 VTS_I4 VTS_PI2)
//}}AFX_EVENTSINK_MAP
END_EVENTSINK_MAP()
void CCfxUserInterface::OnGetTipChart1(short nHit, short nSerie, long nPoint, short FAR* nRes)
{
char buffer[80];
strcpy(buffer, "You are hitting the ");
switch(nHit)
{
case HIT_TOPTITLE:
m_pChartFX->HText = strcat(buffer, m_pChartFX->HText);
*nRes = 1;
break;
case HIT_AXISX:
m_pChartFX->HText = strcat(buffer, m_pChartFX->HText);
*nRes = 1;
break;
case HIT_AXISY:
m_pChartFX->HText = strcat(buffer, m_pChartFX->HText);
*nRes = 1;
break;
case HIT_POINT:
case HIT_BETWEEN:
m_pChartFX->HText = strcat(buffer, m_pChartFX->HText);
*nRes = 1;
break;
case HIT_BKGND:
m_pChartFX->HText = strcat(buffer, m_pChartFX->HText);
*nRes = 1;
break;
case HIT_3DBK:
m_pChartFX->HText = strcat(buffer, m_pChartFX->HText);
*nRes = 1;
break;
}
}
void CCfxUserInterface::OnLButtonDblClkChart1(short x, short y, short nSerie, long nPoint, short FAR* nRes)
{
char buffer[80], t[20];
strcpy(t,m_pChartFX->HText);
if (strcmp(t, ""))
if (m_pChartFX->ValueEx[nSerie][nPoint] > 50) {
strcpy(buffer, "This value is greater than 50... ");
m_pChartFX->HText = strcat(buffer, m_pChartFX->HText);
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -