startdlg.cpp

来自「本软件实现了模拟cpu的基本工作原理和工作过程」· C++ 代码 · 共 65 行

CPP
65
字号
// STARTDLG.cpp : implementation file
//

#include "stdafx.h"
#include "AM.h"
#include "STARTDLG.h"

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

/////////////////////////////////////////////////////////////////////////////
// STARTDLG dialog


STARTDLG::STARTDLG(CWnd* pParent /*=NULL*/)
	: CDialog(STARTDLG::IDD, pParent)
{
	//{{AFX_DATA_INIT(STARTDLG)
	m_startpoint = _T("");
	m_title = _T("");
	//}}AFX_DATA_INIT
}


void STARTDLG::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(STARTDLG)
	DDX_Text(pDX, IDC_STARTPOINT_EDIT, m_startpoint);
	DDV_MaxChars(pDX, m_startpoint, 4);
	DDX_Text(pDX, IDC_TITTLE_EDIT, m_title);
	//}}AFX_DATA_MAP
}


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

/////////////////////////////////////////////////////////////////////////////
// STARTDLG message handlers

void STARTDLG::OnOK() 
{
	UpdateData(true);
	m_startpoint.MakeUpper();
	if(m_startpoint.GetLength()<4){
		AfxMessageBox("起始地址有误,请重新输入!\n\n格式要求:4位16进制数");
		return;
	}
	char temp[10];
	strcpy(temp,m_startpoint);
	for(int i=0;i<4;i++){
		if(temp[i]<'0'||(temp[i]>'9' && temp[i]<'A')||temp[i]>'F'){
			AfxMessageBox("起始地址有误,请重新输入!\n\n格式要求:4位16进制数");
			return;
		}
	}
	CDialog::OnOK();
}

⌨️ 快捷键说明

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