?? inputcombobox.cpp
字號:
// InputComboBox.cpp : implementation file
//
#include "stdafx.h"
#include "prop.h"
#include "InputComboBox.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CInputComboBox
CInputComboBox::CInputComboBox()
{
}
CInputComboBox::~CInputComboBox()
{
}
BEGIN_MESSAGE_MAP(CInputComboBox, CComboBox)
//{{AFX_MSG_MAP(CInputComboBox)
ON_CONTROL_REFLECT(CBN_SELCHANGE, OnSelchange)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CInputComboBox message handlers
void CInputComboBox::OnSelchange()
{
// TODO: Add your control notification handler code here
int nIndex = GetCurSel();
GetLBText(nIndex, m_strInput);
// InvokeAction();
}
BOOL CInputComboBox::PreTranslateMessage(MSG* pMsg)
{
// TODO: Add your specialized code here and/or call the base class
if (pMsg->message == WM_KEYDOWN && pMsg->wParam == VK_RETURN) {
OnCmd(0);
}
return CComboBox::PreTranslateMessage(pMsg);
}
void CInputComboBox::InvokeAction(int type)
{
extern CPropApp theApp;
CString strTmp1 = "build F:/其他書籍/概率句法分析器/prop/propexec/pcfg-上下文無關.txt";
CString strTmp2 = "build F:/其他書籍/概率句法分析器/prop/propexec/prcfg-結構上下文相關.txt";
CString strTmp3 = "parse F:/其他書籍/概率句法分析器/prop/propexec/test-測試例句.txt";
if( 0 == type )
{
m_strInput = strTmp1;
}
if( 1 == type )
{
m_strInput = strTmp2;
}
if( 2 == type )
{
m_strInput = strTmp3;
}
theApp.ExecCmd(m_strInput);
}
void CInputComboBox::UpdateInput()
{
int nIndex=AddUniqueString(m_strInput);
SetCurSel(nIndex);
}
void CInputComboBox::OnCmd(int type)
{
//GetWindowText(m_strInput);
//AddUniqueString(m_strInput);
InvokeAction(type);
}
int CInputComboBox::AddUniqueString(CString str)
{
int nIndex=0;
int nCount=GetCount();
nIndex=FindStringExact(nIndex, LPCSTR(str));
if (nIndex!=LB_ERR)
return nIndex;
else
return InsertString(0, (LPCSTR)str);
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -