⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 dlgsetface.cpp

📁 俄罗斯方块
💻 CPP
字号:
// DlgSetFace.cpp : implementation file
//

#include "stdafx.h"
#include "ElsGame.h"
#include "DlgSetFace.h"
#include "ElsGameDlg.h"

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

/////////////////////////////////////////////////////////////////////////////
// CDlgSetFace dialog


CDlgSetFace::CDlgSetFace(CWnd* pParent /*=NULL*/)
	: CDialog(CDlgSetFace::IDD, pParent)
{
	//{{AFX_DATA_INIT(CDlgSetFace)
	m_bChkSameGraph = FALSE;
	//}}AFX_DATA_INIT
}


void CDlgSetFace::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CDlgSetFace)
	DDX_Check(pDX, IDC_CHKSAMEGH, m_bChkSameGraph);
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(CDlgSetFace, CDialog)
	//{{AFX_MSG_MAP(CDlgSetFace)
	ON_WM_HSCROLL()
	ON_BN_CLICKED(IDC_CHKSAMEGH, OnChksamegh)
	ON_BN_CLICKED(IDC_RCBLOCK, OnRcblock)
	ON_BN_CLICKED(IDC_RCARTOON, OnRcartoon)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CDlgSetFace message handlers

void CDlgSetFace::PostNcDestroy() 
{
	delete this;
}

void CDlgSetFace::OnCancel() 
{
	((CElsGameDlg*)this->GetParent())->m_pDlgSetFace=NULL;
	DestroyWindow();
}

BOOL CDlgSetFace::OnInitDialog() 
{
	CDialog::OnInitDialog();
	m_hIcon=LoadIcon(AfxGetApp()->m_hInstance,MAKEINTRESOURCE(IDR_MAINFRM));
	SetIcon(m_hIcon, TRUE);			// Set big icon
	m_hIcon=LoadIcon(AfxGetApp()->m_hInstance,MAKEINTRESOURCE(IDI_MAINFRMSM));	
	SetIcon(m_hIcon, FALSE);		// Set small icon
	
	m_bChkSameGraph=((CElsGameDlg*)this->GetParent())->m_bSameGraph;
	m_rStyleValue=((CElsGameDlg*)this->GetParent())->m_nBmpType;
	if(m_rStyleValue==0)
		this->CheckRadioButton(IDC_RCBLOCK,IDC_RCARTOON,IDC_RCBLOCK);
	else
		this->CheckRadioButton(IDC_RCBLOCK,IDC_RCARTOON,IDC_RCARTOON);
	
	UpdateData(FALSE);
	return TRUE;  // return TRUE unless you set the focus to a control
	              // EXCEPTION: OCX Property Pages should return FALSE
}

void CDlgSetFace::OnOK() 
{
	// TODO: Add extra validation here
	((CElsGameDlg*)this->GetParent())->m_pDlgSetFace=NULL;
	((CElsGameDlg*)this->GetParent())->m_bSameGraph=m_bChkSameGraph;
	if(m_rStyleValue!=((CElsGameDlg*)this->GetParent())->m_nBmpType)
	{
		((CElsGameDlg*)this->GetParent())->m_nBmpType=m_rStyleValue;
		((CElsGameDlg*)this->GetParent())->ReLoadBitmap();
	}
	((CElsGameDlg*)this->GetParent())->Invalidate();

	DestroyWindow();
	//CDialog::OnOK();
}

void CDlgSetFace::OnChksamegh() 
{
	UpdateData();	
}

void CDlgSetFace::OnRcblock() 
{
	m_rStyleValue=0;		
}

void CDlgSetFace::OnRcartoon() 
{
	m_rStyleValue=1;	
}

⌨️ 快捷键说明

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