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

📄 filesetdlg.cpp

📁 打印数据生成和模拟
💻 CPP
字号:
// filesetdlg.cpp : implementation file
//

#include "stdafx.h"
#include "..\Search.h"
#include "..\ToolSoftForPrint.h"
#include "filesetdlg.h"

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

/////////////////////////////////////////////////////////////////////////////
// CFileSetDlg dialog


CFileSetDlg::CFileSetDlg(CWnd* pParent /*=NULL*/)
	: CDialog(CFileSetDlg::IDD, pParent)
{
	//{{AFX_DATA_INIT(CFileSetDlg)
		// NOTE: the ClassWizard will add member initialization here
	//}}AFX_DATA_INIT
}


void CFileSetDlg::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CFileSetDlg)
	DDX_Control(pDX, IDC_COMMONDIALOG1, m_fileDlg);
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(CFileSetDlg, CDialog)
	//{{AFX_MSG_MAP(CFileSetDlg)
	ON_BN_CLICKED(IDC_BUTTON_FilePath, OnBUTTONFilePath)
	ON_WM_CREATE()
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CFileSetDlg message handlers

void CFileSetDlg::OnOK() 
{
	
	CString strFilePath("");
	CString strAppPath(""),strConfPath("");
	CSuperFileProc filePro;
	Search m_search(CUtilityClass::getAppPath()+"\\DATA","*.prt");


	CEdit * pEditFilePath = (CEdit *)this->GetDlgItem(IDC_EDIT_FilePath);
	pEditFilePath->GetWindowText(strFilePath);

	strAppPath =CUtilityClass::getAppPath();
	strConfPath = strAppPath + "\\conf\\";
	if (FALSE == filePro.Exist(strConfPath+"conf.ini"))
		filePro.CreateFolder(strConfPath);

	CUtilityClass::WriteIniValue("FileSet","DataPath",strFilePath,strConfPath+"conf.ini");
	
	CDialog::OnOK();
}

void CFileSetDlg::OnBUTTONFilePath() 
{
	CSuperFileProc filePro;
	CString s;
	filePro.BrowseForFolder(this);
	if ("" != filePro.GetCurrentFolder())
	{
		CEdit * pEditFilePath = (CEdit *)this->GetDlgItem(IDC_EDIT_FilePath);
		CString strPath =filePro.GetCurrentFolder();
		if (strPath.Right(1) != "\\")
			strPath = strPath + "\\";
		pEditFilePath->SetWindowText(strPath);
	}		
}

BOOL CFileSetDlg::OnInitDialog() 
{
	CDialog::OnInitDialog();
	
	CString strDataPathValue = CUtilityClass::getIniValueString("FileSet","DataPath","",CUtilityClass::getAppPath()+"\\conf\\conf.ini");
	CEdit * pEditFilePath = (CEdit *)this->GetDlgItem(IDC_EDIT_FilePath);
	pEditFilePath->SetWindowText(strDataPathValue);
	

	
	return TRUE;  // return TRUE unless you set the focus to a control
	              // EXCEPTION: OCX Property Pages should return FALSE
}

int CFileSetDlg::OnCreate(LPCREATESTRUCT lpCreateStruct) 
{
	if (CDialog::OnCreate(lpCreateStruct) == -1)
		return -1;
	
	// TODO: Add your specialized creation code here
	
	return 0;
}

⌨️ 快捷键说明

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