📄 programdlg.cpp
字号:
// Programdlg.cpp : implementation file
//
#include "stdafx.h"
#include "Dsp7.h"
#include "Programdlg.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CProgramdlg dialog
CProgramdlg::CProgramdlg(CWnd* pParent /*=NULL*/)
: CDialog(CProgramdlg::IDD, pParent)
{
//{{AFX_DATA_INIT(CProgramdlg)
m_program = _T("");
m_pcode = _T("");
//}}AFX_DATA_INIT
}
void CProgramdlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CProgramdlg)
DDX_Text(pDX, IDC_EDIT_PROGRAM, m_program);
DDV_MaxChars(pDX, m_program, 4);
DDX_Text(pDX, IDC_EDIT_PCODE, m_pcode);
DDV_MaxChars(pDX, m_pcode, 4);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CProgramdlg, CDialog)
//{{AFX_MSG_MAP(CProgramdlg)
ON_EN_KILLFOCUS(IDC_EDIT_PCODE, OnKillfocusEditPcode)
ON_EN_KILLFOCUS(IDC_EDIT_PROGRAM, OnKillfocusEditProgram)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CProgramdlg message handlers
void CProgramdlg::OnKillfocusEditPcode()
{
// TODO: Add your control notification handler code here
UpdateData(true);
CString str;
str=m_pcode;
int len=str.GetLength();
for(int i=0;i<len;i++)
if(!isxdigit(str[i])){MessageBox("DATA ERROR!!!");break;}
UpdateData(false);
}
void CProgramdlg::OnKillfocusEditProgram()
{
// TODO: Add your control notification handler code here
UpdateData(true);
CString str;
str=m_program;
int len=str.GetLength();
for(int i=0;i<len;i++)
if(!isxdigit(str[i])){MessageBox("DATA ERROR!!!");break;}
UpdateData(false);
}
BOOL CProgramdlg::OnInitDialog()
{
CDialog::OnInitDialog();
// TODO: Add extra initialization here
m_program="9000";
UpdateData(FALSE);
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 + -