www.pudn.com > c02 vc6.rar > FindInCurFile.cpp


// FindInCurFile.cpp : implementation file 
// 
 
#include "stdafx.h" 
#include "c02ide.h" 
#include "C02IDEView.h" 
#include "FindInCurFile.h" 
#include "MainFrm.h" 
#ifdef _DEBUG 
#define new DEBUG_NEW 
#undef THIS_FILE 
static char THIS_FILE[] = __FILE__; 
#endif 
 
///////////////////////////////////////////////////////////////////////////// 
// CFindInCurFile dialog 
 
 
CFindInCurFile::CFindInCurFile(CWnd* pParent /*=NULL*/) 
	: CDialog(CFindInCurFile::IDD, pParent) 
{ 
	//{{AFX_DATA_INIT(CFindInCurFile) 
	m_find = _T(""); 
	//}}AFX_DATA_INIT 
	a_searchinfo.RemoveAll(); 
 
} 
 
 
void CFindInCurFile::DoDataExchange(CDataExchange* pDX) 
{ 
	CDialog::DoDataExchange(pDX); 
	//{{AFX_DATA_MAP(CFindInCurFile) 
//	DDX_Control(pDX, IDC_TEST, m_staticText); 
	DDX_Control(pDX, IDC_EDIT_FIND, m_edit); 
	DDX_Text(pDX, IDC_EDIT_FIND, m_find); 
	//}}AFX_DATA_MAP 
} 
 
 
BEGIN_MESSAGE_MAP(CFindInCurFile, CDialog) 
	//{{AFX_MSG_MAP(CFindInCurFile) 
	ON_EN_CHANGE(IDC_EDIT_FIND, OnChangeEditFind) 
	ON_WM_MOUSEMOVE() 
	//}}AFX_MSG_MAP 
END_MESSAGE_MAP() 
 
///////////////////////////////////////////////////////////////////////////// 
// CFindInCurFile message handlers 
 
void CFindInCurFile::OnChangeEditFind()  
{ 
	// 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. 
	 
	// TODO: Add your control notification handler code here 
	UpdateData(); 
 
    findstring=m_find; 
 
  
	UpdateData(FALSE);	 
 
} 
 
void CFindInCurFile::OnOK()  
{ 
	// TODO: Add extra validation here 
	findstring=m_find; 
	findstringcurhang=0; 
	findstringcurlie=0; 
	CString str_filefind=_T(""); 
 
	CMDIFrameWnd* mdif=(CMDIFrameWnd*)(AfxGetApp()->m_pMainWnd); 
	CMDIChildWnd*childf=mdif->MDIGetActive(); 
 
 
	CC02IDEView *childview = (CC02IDEView *)childf->GetActiveView(); 
   
	CCrystalTextView* m_pexpandview=NULL; 
	 
 
	m_pexpandview=(CCrystalTextView*)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); 
 
 
 
		 
 
	}while(n_canfind=1&&findstringcurhang<=linenum-1); 
 
 
 
	 m_pmainFrame->m_wndOutput.UpDateSearch1(); 
 
//	CDialog::OnOK(); 
	 DestroyWindow (); 
} 
 
BOOL CFindInCurFile::OnInitDialog()  
{ 
	CDialog::OnInitDialog(); 
	 
//	 m_TitleTip.Create(this); 
	// TODO: Add extra initialization here 
	GetDlgItem(IDC_EDIT_FIND)->SetFocus(); 
	return TRUE;  // return TRUE unless you set the focus to a control 
	              // EXCEPTION: OCX Property Pages should return FALSE 
} 
 
void CFindInCurFile::OnMouseMove(UINT nFlags, CPoint point)  
{ 
	// TODO: Add your message handler code here and/or call default 
	 CRect rect; 
    m_edit.GetWindowRect(rect); 
	 
    ScreenToClient(rect); 
 //  rect.top=	rect.top+30; 
 
    if (rect.PtInRect(point)) 
    { 
        CString str; 
        m_staticText.GetWindowText(str); 
		str=str+"df\nddf\ndf\ndaf\ndf\n\n\n\n\n"; 
//        m_TitleTip.Show(rect, str, 0, 80); 
    } 
	 
	CDialog::OnMouseMove(nFlags, point); 
}