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

📄 addpropertydlg.cpp

📁 文档生成工具 XML例子
💻 CPP
字号:
// AddPropertyDlg.cpp : implementation file
//

#include "stdafx.h"
#include "XMLClassDoc.h"
#include "AddPropertyDlg.h"
#include "DocManage.h"

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

/////////////////////////////////////////////////////////////////////////////
// CAddPropertyDlg dialog


CAddPropertyDlg::CAddPropertyDlg(CWnd* pParent /*=NULL*/)
	: CDialog(CAddPropertyDlg::IDD, pParent)
{
	//{{AFX_DATA_INIT(CAddPropertyDlg)
	m_strComboType = _T("");
	m_strPropertyType = _T("");
	m_strPropertyName = _T("");
	//}}AFX_DATA_INIT
}


void CAddPropertyDlg::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CAddPropertyDlg)
	DDX_CBString(pDX, IDC_COMBO_TYPE, m_strComboType);
	DDX_Text(pDX, IDC_EDIT_PROPERTYTYPE, m_strPropertyType);
	DDX_Text(pDX, IDC_EDIT_PROPERTYNAME, m_strPropertyName);
	//}}AFX_DATA_MAP
}


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

/////////////////////////////////////////////////////////////////////////////
// CAddPropertyDlg message handlers

void CAddPropertyDlg::OnOK() 
{	
	UpdateData(true);
	m_strPropertyName.TrimLeft();
	m_strPropertyName.TrimRight();
	if (m_strPropertyName.IsEmpty())
	{
		MessageBox("请输入属性名!");
		return;
	}
	CDocManage *pDocManage = new CDocManage();
	pDocManage->AddProperty(m_strClassName, m_strPropertyType, m_strPropertyName, m_strComboType);
	delete pDocManage;
	CDialog::OnOK();
}

BOOL CAddPropertyDlg::OnInitDialog() 
{
	CDialog::OnInitDialog();	
	((CComboBox*)GetDlgItem(IDC_COMBO_TYPE))->SetCurSel(1);		
	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 + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -