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

📄 dlgproject.cpp

📁 自动化编译工具代码
💻 CPP
字号:
// DlgProject.cpp : implementation file
//

#include "stdafx.h"
#include "vssreporter.h"
#include "DlgProject.h"

#include "CommonFunction.h"
using namespace CCommonFunction;

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

/////////////////////////////////////////////////////////////////////////////
// CDlgProject dialog


CDlgProject::CDlgProject(CWnd* pParent /*=NULL*/)
	: CDialog(CDlgProject::IDD, pParent)
{
	//{{AFX_DATA_INIT(CDlgProject)
	m_strProjectFile = _T("");
	m_strProjectName = _T("");
	m_strVSSPath = _T("");
	//}}AFX_DATA_INIT
}


void CDlgProject::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CDlgProject)
	DDX_Control(pDX, IDC_COMBO_ProjectVersion, m_cComboPrjVer);
	DDX_Control(pDX, IDC_COMBO_ConfigType, m_cComboBuildType);
	DDX_Text(pDX, IDC_EDIT_ProjectFile, m_strProjectFile);
	DDX_Text(pDX, IDC_EDIT_ProjectName, m_strProjectName);
	DDX_Text(pDX, IDC_EDIT_VSSPath, m_strVSSPath);
	//}}AFX_DATA_MAP
}


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

/////////////////////////////////////////////////////////////////////////////
// CDlgProject message handlers

BOOL CDlgProject::OnInitDialog() 
{
	CDialog::OnInitDialog();
	
	// TODO: Add extra initialization here
	if (m_strBuildType.IsEmpty())
		m_cComboBuildType.SetCurSel(0);
	else
	{
		const int nFindPos = m_cComboBuildType.FindString(0, m_strBuildType);
		if (nFindPos == LB_ERR)
			m_cComboBuildType.SetWindowText(m_strBuildType);
		else
			m_cComboBuildType.SetCurSel(nFindPos);
	}

	if (m_strProjectVersion.IsEmpty())		//添加
	{
		if (GetFileExtName(m_strProjectFile).CompareNoCase(".sln") == 0)
			m_cComboPrjVer.SetCurSel(3);	//VC2005
		else
			m_cComboPrjVer.SetCurSel(0);	//VC60
	}
	else
	{
		const int nFindPos = m_cComboPrjVer.FindString(0, m_strProjectVersion);
		ASSERT(nFindPos != LB_ERR);
		m_cComboPrjVer.SetCurSel(nFindPos);
	}
	
	return TRUE;  // return TRUE unless you set the focus to a control
	              // EXCEPTION: OCX Property Pages should return FALSE
}

void CDlgProject::OnOK() 
{
	UpdateData();

	m_cComboBuildType.GetWindowText(m_strBuildType);
	m_cComboPrjVer.GetLBText(m_cComboPrjVer.GetCurSel(), m_strProjectVersion);

	if (m_strBuildType.IsEmpty())
	{
		MessageBox("ConfigType is must not be empty!", "Error!", MB_OK | MB_ICONERROR);
		return;
	}

	CDialog::OnOK();
}

⌨️ 快捷键说明

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