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

📄 trainparamspage.cpp

📁 良好的代码实现
💻 CPP
字号:
// TrainParamsPage.cpp : implementation file
//

#include "stdafx.h"
#include "TextClassify.h"
#include "TrainParamsPage.h"
#include "WzdDrDlg.h"
#include <direct.h>

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

/////////////////////////////////////////////////////////////////////////////
// CTrainParamsPage property page

IMPLEMENT_DYNCREATE(CTrainParamsPage, CPropertyPage)

CTrainParamsPage::CTrainParamsPage() : CPropertyPage(CTrainParamsPage::IDD)
{
	//{{AFX_DATA_INIT(CTrainParamsPage)
	m_txtResultDir = _T("");
	m_txtTrainDir = _T("");
	m_nFSMode = 0;
	m_nWordSize = 2000;
	m_nOpMode = -1;
	m_nSelMode = -1;
	m_bStem = FALSE;
	m_nLanguageType = 0;
	m_nWeightMode = -1;

	//}}AFX_DATA_INIT
}

CTrainParamsPage::~CTrainParamsPage()
{
}

void CTrainParamsPage::DoDataExchange(CDataExchange* pDX)
{
	CPropertyPage::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CTrainParamsPage)
	DDX_Radio(pDX, IDC_RADIO_FS_IG, m_nFSMode);
	DDX_Radio(pDX,IDC_RADIO_WEIGHT,m_nWeightMode);
	DDX_Text(pDX, IDC_TXT_RESULT, m_txtResultDir);
	DDX_Text(pDX, IDC_TXT_TRAIN_DIR, m_txtTrainDir);
	DDX_Text(pDX, IDC_TXT_WORD_SIZE, m_nWordSize);
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(CTrainParamsPage, CPropertyPage)
	//{{AFX_MSG_MAP(CTrainParamsPage)
	ON_BN_CLICKED(IDC_BTN_TRAIN, OnBtnTrain)
	ON_BN_CLICKED(IDC_BTN_RESULTS, OnBtnResults)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CTrainParamsPage message handlers

void CTrainParamsPage::OnBtnTrain() 
{
	// TODO: Add your control notification handler code here
	UpdateData(true);	
	CWzdDirDlg dlg;
	CString dir=dlg.GetDirectory(this);
	if(!dir.IsEmpty())
	{
		m_txtTrainDir=dir;
		UpdateData(FALSE);	
	}	
}

void CTrainParamsPage::OnBtnResults() 
{
	// TODO: Add your control notification handler code here
	UpdateData(true);
	CWzdDirDlg dlg;
	CString dir=dlg.GetDirectory(this);
	if(!dir.IsEmpty())
	{
		m_txtResultDir=dir;
		UpdateData(FALSE);	
	}
}

BOOL CTrainParamsPage::OnInitDialog() 
{
	CPropertyPage::OnInitDialog();
//	::EnableWindow((GetDlgItem(IDC_CHK_STEM))->m_hWnd,m_nLanguageType);	
	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 + -