newwindow.cpp

来自「esDice.ico This an icon file, which is」· C++ 代码 · 共 64 行

CPP
64
字号
// NewWindow.cpp : implementation file
//

#include "stdafx.h"
#include "Dice.h"
#include "NewWindow.h"
#include <string>
using namespace std;

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

/////////////////////////////////////////////////////////////////////////////
// NewWindow dialog


NewWindow::NewWindow(CWnd* pParent /*=NULL*/)
	: CDialog(NewWindow::IDD, pParent)
{
	//{{AFX_DATA_INIT(NewWindow)
	m_dicenum = 0;
	m_expnum = 0;
	//}}AFX_DATA_INIT
}


void NewWindow::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(NewWindow)
	DDX_Control(pDX, IDC_EDIT1, m_text1);
	DDX_Control(pDX, IDC_EDIT2, m_text2);
	DDX_Text(pDX, IDC_EDIT1, m_dicenum);
	DDX_Text(pDX, IDC_EDIT2, m_expnum);
	//}}AFX_DATA_MAP
}


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

/////////////////////////////////////////////////////////////////////////////
// NewWindow message handlers

void NewWindow::OnOK() 
{
	int n1,n2;
    CString str1,str2;
	m_text1.GetWindowText(str1);
    m_text2.GetWindowText(str2);
	n1 = atoi(str1);
	n2 = atoi(str2);
	if(n1>0&&n2>0)
	   CDialog::OnOK();
	else
	   MessageBox("输入数据有误!请重新输入");
}

⌨️ 快捷键说明

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