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

📄 askreplacedialog.cpp

📁 Crimson编辑器的英文版,完成从韩文版变成英文版的移植,并且附带可执行文件和注册表文件,无需原先的安装包,是改写编辑器的最理想选择.
💻 CPP
字号:
// AskReplaceDialog.cpp : implementation file
//

#include "stdafx.h"
#include "resource.h"
#include "AskReplaceDialog.h"

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

/////////////////////////////////////////////////////////////////////////////
// CAskReplaceDialog dialog


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


void CAskReplaceDialog::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CAskReplaceDialog)
		// NOTE: the ClassWizard will add DDX and DDV calls here
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(CAskReplaceDialog, CDialog)
	//{{AFX_MSG_MAP(CAskReplaceDialog)
	ON_BN_CLICKED(IDYES, OnYes)
	ON_BN_CLICKED(IDNO, OnNo)
	ON_BN_CLICKED(ID_ALL, OnAll)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CAskReplaceDialog message handlers

BOOL CAskReplaceDialog::OnInitDialog() 
{
	CDialog::OnInitDialog();

	RECT rect; GetWindowRect( & rect );
	int width = rect.right - rect.left;
	int height = rect.bottom - rect.top;

	rect.left = m_ptInitialPos.x;
	rect.top = m_ptInitialPos.y;
	rect.right = rect.left + width;
	rect.bottom = rect.top + height;
	MoveWindow( & rect );
	
	return TRUE;
}

void CAskReplaceDialog::OnYes() 
{
	m_bReplaceAll = FALSE;
	m_bSearchNext = TRUE;
	m_bSearchPrev = FALSE;
	CDialog::OnOK();
}

void CAskReplaceDialog::OnNo() 
{
	m_bReplaceAll = FALSE;
	m_bSearchNext = TRUE;
	m_bSearchPrev = FALSE;
	CDialog::OnCancel();
}

void CAskReplaceDialog::OnAll() 
{
	m_bReplaceAll = TRUE;
	m_bSearchNext = FALSE;
	m_bSearchPrev = FALSE;
	CDialog::OnCancel();
}

void CAskReplaceDialog::OnOK() 
{
	m_bReplaceAll = FALSE;
	m_bSearchNext = FALSE;
	m_bSearchPrev = FALSE;
	CDialog::OnOK();
}

void CAskReplaceDialog::OnCancel() 
{
	m_bReplaceAll = FALSE;
	m_bSearchNext = FALSE;
	m_bSearchPrev = FALSE;
	CDialog::OnCancel();
}

BOOL CAskReplaceDialog::PreTranslateMessage(MSG* pMsg) 
{
	switch( pMsg->message ) {
	case WM_KEYDOWN:
		switch( pMsg->wParam ) {
		case VK_F3:
			if( GetKeyState(VK_SHIFT) & 0xF0 ) {
				m_bReplaceAll = FALSE;
				m_bSearchNext = FALSE;
				m_bSearchPrev = TRUE;
				CDialog::OnCancel();
			} else {
				m_bReplaceAll = FALSE;
				m_bSearchNext = TRUE;
				m_bSearchPrev = FALSE;
				CDialog::OnCancel();
			}
			break;
		}
		break;
	}
	
	return CDialog::PreTranslateMessage(pMsg);
}

⌨️ 快捷键说明

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