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

📄 demodlg.cpp

📁 这是MFC经典问答书的光盘内容
💻 CPP
字号:
// DemoDlg.cpp : implementation file
//

#include "stdafx.h"
#include "GetActiveDoc.h"
#include "DemoDlg.h"

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

/////////////////////////////////////////////////////////////////////////////
// CDemoDlg dialog

CDemoDlg::CDemoDlg( CDrawDoc* pDoc, CWnd* pParent /*=NULL*/ )
	: CDialog(CDemoDlg::IDD, pParent)
{
	ASSERT_VALID( pDoc );
	m_pDoc = pDoc;

	//{{AFX_DATA_INIT(CDemoDlg)
	//}}AFX_DATA_INIT
}

void CDemoDlg::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);

	// The m_shape variable needs special handling because
	// it is defined as an enumeration in the document class
	// as follows:
	// enum SHAPE { SQUARE = 0, CIRCLE = 1 } m_shape;
	int nShape = -1;
	if( !pDX->m_bSaveAndValidate )
	{
		nShape = m_pDoc->m_shape;
	}

	//{{AFX_DATA_MAP(CDemoDlg)
	DDX_Control(pDX, IDC_SHAPE, m_cmbShape);
	DDX_Control(pDX, IDC_Y, m_edtY);
	DDX_Control(pDX, IDC_X, m_edtX);
	DDX_Text(pDX, IDC_X, m_pDoc->m_point.x);
	DDX_Text(pDX, IDC_Y, m_pDoc->m_point.y);
	DDX_CBIndex(pDX, IDC_SHAPE, nShape);
	//}}AFX_DATA_MAP

	if( pDX->m_bSaveAndValidate )
	{
		m_pDoc->m_shape = static_cast< CDrawDoc::SHAPE >( nShape );
	}
}

BEGIN_MESSAGE_MAP(CDemoDlg, CDialog)
	//{{AFX_MSG_MAP(CDemoDlg)
		// NOTE: the ClassWizard will add message map macros here
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CDemoDlg message handlers

⌨️ 快捷键说明

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