www.pudn.com > NiHe > ShuJuInput.cpp


// ShuJuInput.cpp : implementation file 
// 
 
#include "stdafx.h" 
#include "NiHe.h" 
#include "ShuJuInput.h" 
#include "NiHeDoc.h" 
 
#ifdef _DEBUG 
#define new DEBUG_NEW 
#undef THIS_FILE 
static char THIS_FILE[] = __FILE__; 
#endif 
 
///////////////////////////////////////////////////////////////////////////// 
// ShuJuInput dialog 
 
 
ShuJuInput::ShuJuInput(CWnd* pParent /*=NULL*/) 
	: CDialog(ShuJuInput::IDD, pParent) 
{ 
	//{{AFX_DATA_INIT(ShuJuInput) 
	m_x = 0.0f; 
	m_y = 0.0f; 
	m_count = 0; 
	//}}AFX_DATA_INIT 
} 
 
 
void ShuJuInput::DoDataExchange(CDataExchange* pDX) 
{ 
	CDialog::DoDataExchange(pDX); 
	//{{AFX_DATA_MAP(ShuJuInput) 
	DDX_Text(pDX, IDC_EDIT1_X, m_x); 
	DDX_Text(pDX, IDC_EDIT2_Y, m_y); 
	DDX_Text(pDX, IDC_EDIT3_COUNT, m_count); 
	//}}AFX_DATA_MAP 
} 
 
 
BEGIN_MESSAGE_MAP(ShuJuInput, CDialog) 
	//{{AFX_MSG_MAP(ShuJuInput) 
	ON_BN_CLICKED(IDC_PARA_INPUT, OnParaInput) 
	//}}AFX_MSG_MAP 
END_MESSAGE_MAP() 
 
///////////////////////////////////////////////////////////////////////////// 
// ShuJuInput message handlers 
 
void ShuJuInput::OnParaInput()  
{ 
	// TODO: Add your control notification handler code here 
	UpdateData(true); 
	m_count++;               //¼ÆÊýÆ÷¸³Öµ 
	pDocdlg->points[m_count].x=m_x; 
    pDocdlg->points[m_count].y=m_y; 
	UpdateData(false); 
} 
 
void ShuJuInput::OnOK()  
{ 
	// TODO: Add extra validation here	 
	CDialog::OnOK(); 
} 
ShuJuInput::Getdocument(CNiHeDoc *pDoc) 
 { 
	 pDocdlg=pDoc; 
 }