www.gusucode.com > VC++增强型“画图版”及图像处理程序源码程序 > VC++增强型“画图版”及图像处理程序源码程序\code\TurnSetDLg.cpp

    //Download by http://www.NewXing.com
// TurnSetDLg.cpp : implementation file
//

#include "stdafx.h"
#include "毕业设计.h"
#include "TurnSetDLg.h"

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

/////////////////////////////////////////////////////////////////////////////
// CTurnSetDLg dialog


CTurnSetDLg::CTurnSetDLg(CWnd* pParent /*=NULL*/)
	: CDialog(CTurnSetDLg::IDD, pParent)
{
	//{{AFX_DATA_INIT(CTurnSetDLg)
	m_d = 0;
	//}}AFX_DATA_INIT
}


void CTurnSetDLg::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CTurnSetDLg)
	DDX_Text(pDX, IDC_EDIT1, m_d);
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(CTurnSetDLg, CDialog)
	//{{AFX_MSG_MAP(CTurnSetDLg)
	ON_BN_CLICKED(IDC_BUTTON2, OnButton2)
	ON_BN_CLICKED(IDC_BUTTON1, OnButton1)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CTurnSetDLg message handlers

void CTurnSetDLg::OnButton2() 
{
	// TODO: Add your control notification handler code here
	OnCancel();
}

void CTurnSetDLg::OnButton1() 
{
	// TODO: Add your control notification handler code here
	OnOK();
}

void CTurnSetDLg::OnOK(){
	if(UpdateData()){
		if(m_d<360&&m_d>-360){
			CDialog::OnOK();
		}
		else{
			MessageBox("请输入一个-359到359之间的数!");
		}
	}
}