herodlg.cpp

来自「这是一个关于扫雷游戏的代码」· C++ 代码 · 共 109 行

CPP
109
字号
// 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
}

⌨️ 快捷键说明

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