📄 rplacedlg.cpp
字号:
// RplaceDlg.cpp : implementation file
//
#include "stdafx.h"
#include "c02ide.h"
#include "RplaceDlg.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CRplaceDlg dialog
CRplaceDlg::CRplaceDlg(CWnd* pParent /*=NULL*/)
: CDialog(CRplaceDlg::IDD, pParent)
{
//{{AFX_DATA_INIT(CRplaceDlg)
m_strrep = _T("");
m_strwith = _T("");
//}}AFX_DATA_INIT
}
void CRplaceDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CRplaceDlg)
DDX_Text(pDX, IDC_EDIT_REP, m_strrep);
DDX_Text(pDX, IDC_EDIT_WITH, m_strwith);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CRplaceDlg, CDialog)
//{{AFX_MSG_MAP(CRplaceDlg)
ON_EN_CHANGE(IDC_EDIT_REP, OnChangeEditRep)
ON_EN_CHANGE(IDC_EDIT_WITH, OnChangeEditWith)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CRplaceDlg message handlers
void CRplaceDlg::OnOK()
{
// TODO: Add extra validation here
CMDIFrameWnd* mdif=(CMDIFrameWnd*)(AfxGetApp()->m_pMainWnd);
CMDIChildWnd*childf=mdif->MDIGetActive();
findstring=m_strrep;
str_with=m_strwith;
findstringcurhang=0;
findstringcurlie=0;
CString str_filefind=_T("");
// CMDIFrameWnd* mdif=(CMDIFrameWnd*)(AfxGetApp()->m_pMainWnd);
// CMDIChildWnd*childf=mdif->MDIGetActive();
CC02IDEView *childview = (CC02IDEView *)childf->GetActiveView();
CCrystalEditView* m_pexpandview=NULL;
m_pexpandview=(CCrystalEditView*)childf->GetActiveView();
// CRichEditCtrl& myeditctrl=childview->GetRichEditCtrl();
int n_canfind=0;
CMainFrame *m_pmainFrame = (CMainFrame*)AfxGetApp()->m_pMainWnd;
int linenum=m_pexpandview->GetLineCount();
do
{
n_canfind= childview->OnFindNext(0,findstring);
m_pexpandview->ReplaceSelection(str_with);
}while(n_canfind=1&&findstringcurhang<=linenum-1);
// m_pmainFrame->m_wndOutput.UpDateSearch1();
// CDialog::OnOK();
DestroyWindow ();
}
void CRplaceDlg::OnChangeEditRep()
{
// TODO: If this is a RICHEDIT control, the control will not
// send this notification unless you override the CDialog::OnInitDialog()
// function and call CRichEditCtrl().SetEventMask()
// with the ENM_CHANGE flag ORed into the mask.
UpdateData();
findstring=m_strrep;
UpdateData(FALSE);
// TODO: Add your control notification handler code here
}
void CRplaceDlg::OnChangeEditWith()
{
// TODO: If this is a RICHEDIT control, the control will not
// send this notification unless you override the CDialog::OnInitDialog()
// function and call CRichEditCtrl().SetEventMask()
// with the ENM_CHANGE flag ORed into the mask.
UpdateData();
str_with=m_strwith;
UpdateData(FALSE);
// TODO: Add your control notification handler code here
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -