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

📄 grammardlg.cpp

📁 中科院开源的ictprop源码,使用方法: 1、修改源码中的InputComboBox.cpp文件 InvokeAction里面的txt文件路径换成你的本地路径; 2、入口在帮助里面
💻 CPP
字号:
// GrammarDlg.cpp : implementation file
//

#include "stdafx.h"
#include <afxdlgs.h>
#include "prop.h"
#include "GrammarDlg.h"

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

/////////////////////////////////////////////////////////////////////////////
// CGrammarDlg dialog


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


void CGrammarDlg::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CGrammarDlg)
	DDX_Control(pDX, IDC_GRAMMARLST, m_glist);
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(CGrammarDlg, CDialog)
	//{{AFX_MSG_MAP(CGrammarDlg)
	ON_BN_CLICKED(IDLOAD, OnLoad)
	ON_LBN_DBLCLK(IDC_GRAMMARLST, OnDblclkGrammarlst)
	ON_WM_DESTROY()
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CGrammarDlg message handlers

void CGrammarDlg::OnLoad() 
{
	// TODO: Add your control notification handler code here
	CFileDialog fdlg(TRUE);

	fdlg.DoModal();

	CString loaded;
	loaded=fdlg.GetPathName();

	m_curg=loaded;
	int nIndex=m_glist.AddString(LPCTSTR(loaded));
	m_glist.SetSel(nIndex, TRUE);

}

void CGrammarDlg::OnDblclkGrammarlst() 
{
	// TODO: Add your control notification handler code here
	int nIndex=m_glist.GetCurSel();

	m_glist.GetText(nIndex, m_curg);
	OnOK();

}

void CGrammarDlg::OnOK()
{
	CDialog::OnOK();
}



BOOL CGrammarDlg::OnInitDialog() 
{
	CDialog::OnInitDialog();
	int i, n=m_gcache.GetCount();
	for (i=0; i<n; i++){
		CString str=m_gcache.RemoveHead();
		m_glist.AddString(str);
	}
	
	//m_glist=m_gcache;
	
	// TODO: Add extra initialization here
	
	return TRUE;  // return TRUE unless you set the focus to a control
	              // EXCEPTION: OCX Property Pages should return FALSE
}

void CGrammarDlg::OnDestroy() 
{
	//m_gcahe=m_glist;
	int i, n=m_glist.GetCount();
	CString str;

	for (i=0; i<n; i++)
	{
		m_glist.GetText(i, str);
		m_gcache.AddTail(LPCTSTR(str));
	}
	CDialog::OnDestroy();
	
	// TODO: Add your message handler code here
	
}

⌨️ 快捷键说明

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