www.pudn.com > ɨÀ×Ô´Âë.rar > HeroDlg.cpp


// HeroDlg.cpp : implementation file 
// 
 
#include "stdafx.h" 
#include "Mine.h" 
#include "HeroDlg.h" 
 
#ifdef _DEBUG 
#define new DEBUG_NEW 
#undef THIS_FILE 
static char THIS_FILE[] = __FILE__; 
#endif 
 
extern CMineApp theApp; 
 
///////////////////////////////////////////////////////////////////////////// 
// CHeroDlg dialog 
 
 
CHeroDlg::CHeroDlg(CWnd* pParent /*=NULL*/) 
	: CDialog(CHeroDlg::IDD, pParent) 
{ 
	//{{AFX_DATA_INIT(CHeroDlg) 
	//}}AFX_DATA_INIT 
} 
 
 
void CHeroDlg::DoDataExchange(CDataExchange* pDX) 
{ 
	CDialog::DoDataExchange(pDX); 
	//{{AFX_DATA_MAP(CHeroDlg) 
 
	DDX_Control(pDX, 701, m_static_P_1); 
	DDX_Control(pDX, 702, m_static_P_2); 
	DDX_Control(pDX, 703, m_static_S_3); 
	DDX_Control(pDX, 704, m_static_S_4); 
	DDX_Control(pDX, 705, m_static_A_5); 
	DDX_Control(pDX, 706, m_static_A_6); 
	 
	//}}AFX_DATA_MAP 
} 
 
 
BEGIN_MESSAGE_MAP(CHeroDlg, CDialog) 
	//{{AFX_MSG_MAP(CHeroDlg) 
	ON_BN_CLICKED(ID_BUTTON_OK, OnButtonOk) 
	ON_BN_CLICKED(ID_BUTTON_RECOUNT, OnButtonReCount) 
	//}}AFX_MSG_MAP 
END_MESSAGE_MAP() 
 
///////////////////////////////////////////////////////////////////////////// 
// CHeroDlg message handlers 
 
void CHeroDlg::OnButtonOk()  
{	 
	CDialog::OnCancel(); 
} 
 
void CHeroDlg::OnButtonReCount()  
{	 
	CString sTemp; 
 
	theApp.sPrimaryRecordHolder = theApp.sResource[1]; 
	theApp.uPrimaryRecord = DEFAULT_RECORD; 
	sTemp.Format( theApp.sResource[0],theApp.uPrimaryRecord); 
	m_static_P_1.SetWindowText( sTemp ); 
	sTemp = theApp.sPrimaryRecordHolder; 
	m_static_P_2.SetWindowText( sTemp ); 
 
	theApp.sSecondaryRecordHolder = theApp.sResource[1]; 
	theApp.uSecondaryRecord = DEFAULT_RECORD; 
	sTemp.Format( theApp.sResource[0],theApp.uSecondaryRecord); 
	m_static_S_3.SetWindowText( sTemp ); 
	sTemp = theApp.sSecondaryRecordHolder; 
	m_static_S_4.SetWindowText( sTemp ); 
 
	theApp.sAdvancedRecordHolder = theApp.sResource[1]; 
	theApp.uAdvancedRecord = DEFAULT_RECORD; 
	sTemp.Format( theApp.sResource[0],theApp.uAdvancedRecord); 
	m_static_A_5.SetWindowText( sTemp ); 
	sTemp = theApp.sAdvancedRecordHolder; 
	m_static_A_6.SetWindowText( sTemp );	 
} 
 
BOOL CHeroDlg::OnInitDialog()  
{ 
	CDialog::OnInitDialog(); 
 
	CString sTemp; 
 
	sTemp.Format( theApp.sResource[0],theApp.uPrimaryRecord); 
	m_static_P_1.SetWindowText( sTemp ); 
	sTemp = theApp.sPrimaryRecordHolder; 
	m_static_P_2.SetWindowText( sTemp ); 
 
	sTemp.Format( theApp.sResource[0],theApp.uSecondaryRecord); 
	m_static_S_3.SetWindowText( sTemp ); 
	sTemp = theApp.sSecondaryRecordHolder; 
	m_static_S_4.SetWindowText( sTemp ); 
 
	sTemp.Format( theApp.sResource[0],theApp.uAdvancedRecord); 
	m_static_A_5.SetWindowText( sTemp ); 
	sTemp = theApp.sAdvancedRecordHolder; 
	m_static_A_6.SetWindowText( sTemp );	 
		 
	return TRUE;  // return TRUE unless you set the focus to a control 
	              // EXCEPTION: OCX Property Pages should return FALSE 
}