VC6中调用 ProEssentials v5图表组件实现科学图表绘制(2)
作者:佚名; 更新时间:2014-12-05
)
{
CreateSimpleSGraph();
// 创建游标 //
PEnset(m_hPE, PEP_nCURSORMODE, PECM_DATACROSS);
// 可以方便的查看数据点//
PEnset(m_hPE, PEP_bMARKDATAPOINTS, TRUE);
// 可以点击数据点来移动游标 //
PEnset(m_hPE, PEP_bMOUSECURSORCONTROL, TRUE);
PEnset(m_hPE, PEP_bALLOWDATAHOTSPOTS, TRUE);
// Cursor prompting in top left corner //
PEnset(m_hPE, PEP_bCURSORPROMPTTRACKING, TRUE);
PEnset(m_hPE, PEP_nCURSORPROMPTSTYLE, PECPS_XYVALUES);
PEnset(m_hPE, PEP_nCURSORPROMPTLOCATION, PECPL_TOP_RIGHT);
// 取消放大功能
PEnset(m_hPE, PEP_nALLOWZOOMING, PEAZ_NONE);
// 其他可能的游标模式如下:
// PECM_NOCURSOR = 0
// PECM_POINT = 1
// PECM_DATACROSS = 2
// PECM_DATASQUARE = 3
// PECM_FLOATINGY = 4
// PECM_FLOATINGXY = 5
// 注意:必须重新初始化
else if ((m_nLastSelection == 105) && (HIWORD(wp) == PEWN_CURSORMOVE))
{ int nSubset, nPoint;
float xvalue, yvalue;
char buffer[64];
nSubset = PEnget(m_hPE, PEP_nCURSORSUBSET);
nPoint = PEnget(m_hPE, PEP_nCURSORPOINT);
PEvgetcellEx(m_hPE, PEP_faXDATA, nSubset, nPoint, &xvalue);
PEvgetcellEx(m_hPE, PEP_faYDATA, nSubset, nPoint, &yvalue);
sprintf(buffer, "Cursor at %d,%d=(%.2f, %.2f)", nSubset, nPoint, xvalue, yvalue);
CWnd* pParent = GetParent()->GetParent();
if (pParent) {pParent->SetWindowText(buffer);}
pParent = AfxGetMainWnd();
if (pParent) {pParent->SetWindowText("PEWN_CURSORMOVE");
return TRUE;
}
}
以上代码在Win2000,VC6环境下调试通过。
{
CreateSimpleSGraph();
// 创建游标 //
PEnset(m_hPE, PEP_nCURSORMODE, PECM_DATACROSS);
// 可以方便的查看数据点//
PEnset(m_hPE, PEP_bMARKDATAPOINTS, TRUE);
// 可以点击数据点来移动游标 //
PEnset(m_hPE, PEP_bMOUSECURSORCONTROL, TRUE);
PEnset(m_hPE, PEP_bALLOWDATAHOTSPOTS, TRUE);
// Cursor prompting in top left corner //
PEnset(m_hPE, PEP_bCURSORPROMPTTRACKING, TRUE);
PEnset(m_hPE, PEP_nCURSORPROMPTSTYLE, PECPS_XYVALUES);
PEnset(m_hPE, PEP_nCURSORPROMPTLOCATION, PECPL_TOP_RIGHT);
// 取消放大功能
PEnset(m_hPE, PEP_nALLOWZOOMING, PEAZ_NONE);
// 其他可能的游标模式如下:
// PECM_NOCURSOR = 0
// PECM_POINT = 1
// PECM_DATACROSS = 2
// PECM_DATASQUARE = 3
// PECM_FLOATINGY = 4
// PECM_FLOATINGXY = 5
// 注意:必须重新初始化
else if ((m_nLastSelection == 105) && (HIWORD(wp) == PEWN_CURSORMOVE))
{ int nSubset, nPoint;
float xvalue, yvalue;
char buffer[64];
nSubset = PEnget(m_hPE, PEP_nCURSORSUBSET);
nPoint = PEnget(m_hPE, PEP_nCURSORPOINT);
PEvgetcellEx(m_hPE, PEP_faXDATA, nSubset, nPoint, &xvalue);
PEvgetcellEx(m_hPE, PEP_faYDATA, nSubset, nPoint, &yvalue);
sprintf(buffer, "Cursor at %d,%d=(%.2f, %.2f)", nSubset, nPoint, xvalue, yvalue);
CWnd* pParent = GetParent()->GetParent();
if (pParent) {pParent->SetWindowText(buffer);}
pParent = AfxGetMainWnd();
if (pParent) {pParent->SetWindowText("PEWN_CURSORMOVE");
return TRUE;
}
}
以上代码在Win2000,VC6环境下调试通过。
下一篇:C语言实现串行通信接口程序
热门论文