?? helpfrmdlg.cpp
字號:
// HelpFrmDlg.cpp : implementation file
//
#include "stdafx.h"
#include "VCStyle.h"
#include "HelpFrmDlg.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CHelpFrmDlg dialog
CHelpFrmDlg::CHelpFrmDlg(CWnd* pParent /*=NULL*/)
: CDialog(CHelpFrmDlg::IDD, pParent)
{
//{{AFX_DATA_INIT(CHelpFrmDlg)
m_addr = 7;
m_ch = 0;
m_delay = 10;
m_param = _T("");
m_res = _T("");
m_cmd = 1;
//}}AFX_DATA_INIT
}
void CHelpFrmDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CHelpFrmDlg)
DDX_Text(pDX, IDC_EDIT_ADDR, m_addr);
DDX_Text(pDX, IDC_EDIT_CH, m_ch);
DDX_Text(pDX, IDC_EDIT_DELAY, m_delay);
DDX_Text(pDX, IDC_EDIT_PARAM, m_param);
DDX_Text(pDX, IDC_EDIT_RESULT, m_res);
DDX_CBIndex(pDX, IDC_COMBO_CMD, m_cmd);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CHelpFrmDlg, CDialog)
//{{AFX_MSG_MAP(CHelpFrmDlg)
ON_CBN_SELCHANGE(IDC_COMBO_CMD, OnSelchangeComboCmd)
ON_EN_CHANGE(IDC_EDIT_DELAY, OnChangeEditDelay)
ON_EN_CHANGE(IDC_EDIT_CH, OnChangeEditCh)
ON_EN_CHANGE(IDC_EDIT_ADDR, OnChangeEditAddr)
ON_EN_CHANGE(IDC_EDIT_PARAM, OnChangeEditParam)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CHelpFrmDlg message handlers
void CHelpFrmDlg::OnSelchangeComboCmd()
{
ShowRes();//顯示結果
}
BYTE CHelpFrmDlg::Sel2Cmd(int sel)
{
switch(sel){
case 0://復位
return 0;
case 1://數據采集
return 2;
case 2://繼電器
return 8;
default:
return 0xff;//not use
}
}
void CHelpFrmDlg::ShowRes()
{
UpdateData();
BYTE cmd = Sel2Cmd(m_cmd);
BYTE param[6];
for(int i=0;i<6;i++){
param[i] = 0;
}
sscanf(m_param,"%2x %2x %2x %2x %2x %2x",¶m[0],¶m[1],¶m[2],
¶m[3],¶m[4],¶m[5]);
m_res.Format("%2x %2x %2x %2x %2x %2x %2x %2x %2x %2x %2x %2x",
m_delay,8,m_addr,0,m_ch,cmd,param[0],param[1],param[2],param[3],param[4],param[5]);
UpdateData(FALSE);
}
void CHelpFrmDlg::OnChangeEditDelay()
{
// TODO: If this is a RICHEDIT control, the control will not
// send this notification unless you override the CDialog::OnInitDialog()
// function and call CRichEditCtrl().SetEventMask()
// with the ENM_CHANGE flag ORed into the mask.
// TODO: Add your control notification handler code here
ShowRes();//顯示結果
}
void CHelpFrmDlg::OnChangeEditCh()
{
// TODO: If this is a RICHEDIT control, the control will not
// send this notification unless you override the CDialog::OnInitDialog()
// function and call CRichEditCtrl().SetEventMask()
// with the ENM_CHANGE flag ORed into the mask.
// TODO: Add your control notification handler code here
ShowRes();//顯示結果
}
void CHelpFrmDlg::OnChangeEditAddr()
{
// TODO: If this is a RICHEDIT control, the control will not
// send this notification unless you override the CDialog::OnInitDialog()
// function and call CRichEditCtrl().SetEventMask()
// with the ENM_CHANGE flag ORed into the mask.
// TODO: Add your control notification handler code here
ShowRes();//顯示結果
}
void CHelpFrmDlg::OnChangeEditParam()
{
// TODO: If this is a RICHEDIT control, the control will not
// send this notification unless you override the CDialog::OnInitDialog()
// function and call CRichEditCtrl().SetEventMask()
// with the ENM_CHANGE flag ORed into the mask.
// TODO: Add your control notification handler code here
ShowRes();//顯示結果
}
BOOL CHelpFrmDlg::OnInitDialog()
{
CDialog::OnInitDialog();
// TODO: Add extra initialization here
ShowRes();//顯示結果
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 + -