newlayerdlg.cpp

来自「使用VC++程序制作的COM组件是地理信息系统的一个实例」· C++ 代码 · 共 75 行

CPP
75
字号
// NewLayerDlg.cpp : implementation file
//

#include "stdafx.h"
#include "ComGIS.h"
#include "NewLayerDlg.h"

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

/////////////////////////////////////////////////////////////////////////////
// CNewLayerDlg dialog


CNewLayerDlg::CNewLayerDlg(CWnd* pParent /*=NULL*/)
	: CDialog(CNewLayerDlg::IDD, pParent)
{
	//{{AFX_DATA_INIT(CNewLayerDlg)
	m_csLayerName = _T("");
	//}}AFX_DATA_INIT
}


void CNewLayerDlg::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CNewLayerDlg)
	DDX_Text(pDX, IDC_EDIT_LAYER_NAME, m_csLayerName);
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(CNewLayerDlg, CDialog)
	//{{AFX_MSG_MAP(CNewLayerDlg)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CNewLayerDlg message handlers

void CNewLayerDlg::OnOK() 
{
	// TODO: Add extra validation here
	UpdateData(TRUE);

	if (!m_csLayerName.IsEmpty())
		CDialog::OnOK();

//	CDialog::OnOK();
}

void CNewLayerDlg::OnCancel() 
{
	// TODO: Add extra cleanup here
	
	CDialog::OnCancel();
}

BOOL CNewLayerDlg::OnInitDialog() 
{
	CDialog::OnInitDialog();
	
	GotoDlgCtrl(GetDlgItem(IDC_EDIT_LAYER_NAME));
	CButton *p = (CButton*)GetDlgItem(IDC_RADIO_VECTOR);
	p->SetCheck(1);

	return FALSE;
	
//	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 + -
显示快捷键?