findcombobx.cpp

来自「微型文本编辑器. 多文档界面」· C++ 代码 · 共 65 行

CPP
65
字号
// FindComboBx.cpp : implementation file
//

#include "stdafx.h"
#include "Wediter.h"
#include "FindComboBx.h"

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

/////////////////////////////////////////////////////////////////////////////
// CFindComboBx

CFindComboBx::CFindComboBx()
{
}

CFindComboBx::~CFindComboBx()
{
}


BEGIN_MESSAGE_MAP(CFindComboBx, CComboBox)
	//{{AFX_MSG_MAP(CFindComboBx)
	ON_CONTROL_REFLECT(CBN_SELCHANGE, OnSelchange)
	ON_CONTROL_REFLECT(CBN_KILLFOCUS, OnKillfocus)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CFindComboBx message handlers

void CFindComboBx::OnSelchange() 
{
	// TODO: Add your control notification handler code here
	CString mstr;
	GetWindowText(mstr);
	if(!mstr.IsEmpty())
	{
		pview->fd.bfind=TRUE;
		pview->fd.text=mstr;
	}

}

void CFindComboBx::OnKillfocus() 
{
	// TODO: Add your control notification handler code here
	CString mstr;
	GetWindowText(mstr);
	if(!mstr.IsEmpty())
	{
		if(SelectString(0,mstr)==CB_ERR)
		{
			InsertString(0,mstr);
			SetCurSel(0);
		}
		pview->fd.bfind=TRUE;
		pview->fd.text=mstr;
	}
}

⌨️ 快捷键说明

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