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

📄 disassemblyctrl.cpp

📁 类似vc的集成开发环境
💻 CPP
字号:
// DisassemblyCtrl.cpp : implementation file
//

#include "stdafx.h"
#include "c02ide.h"
#include "DisassemblyCtrl.h"

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

/////////////////////////////////////////////////////////////////////////////
// CDisassemblyCtrl

CDisassemblyCtrl::CDisassemblyCtrl()
{
}

CDisassemblyCtrl::~CDisassemblyCtrl()
{
}


BEGIN_MESSAGE_MAP(CDisassemblyCtrl, CRichEditCtrl)
	//{{AFX_MSG_MAP(CDisassemblyCtrl)
	ON_WM_LBUTTONDBLCLK()
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CDisassemblyCtrl message handlers

void CDisassemblyCtrl::OnLButtonDblClk(UINT nFlags, CPoint point) 
{
	// TODO: Add your message handler code here and/or call default
	
	CRichEditCtrl::OnLButtonDblClk(nFlags, point);
	int n_selline=0;
		//主窗口指针
    CMainFrame *m_pCMainFrame=(CMainFrame*)(AfxGetApp()->m_pMainWnd);
  
	CMDIFrameWnd * nowframe = (CMDIFrameWnd*)AfxGetApp()->m_pMainWnd;
	//活动子窗口指针
	CMDIChildWnd *nowchild = nowframe->MDIGetActive();
   	CCrystalTextView *m_pchildview = (CCrystalTextView *)nowchild->GetActiveView();
	CC02IDEView *m_pview = (CC02IDEView *)nowchild->GetActiveView();

//	CCrystalEditView *m_pchildeditview = (CCrystalEditView *)nowchild->GetActiveView();

	CHARRANGE cr;

	GetSel(cr);
//SSERT_VALIDTEXTPOS(ptCursorPos);
	//当前光标位置的行索引
    int n_selstart = cr.cpMin;
 

	int i=0;
//	int j=0;
//	while ((i<=n_cal)&&(LineIndex(i)<n_selstart)) 
	while (LineIndex(i)<n_selstart) 
	{
//		j=this->LineLength(i);
//		n_selstart=n_selstart-j;
		i++;
		//双击的最后一行,退出
//		if(i>n_cal&&LineIndex(i)<n_selstart)
//		return;     

	}
//	i--;	
	n_selline=i-1;
	//获得搜索结果的总条数		
	//双击的是第一行,退出
	if(n_selline<0)
			return;  	

//	m_perr=(ErrStruct *)oa_error.GetAt(n_selline-1);
 


	int gotoline=m_pview->com.GetLineno(n_selline);
	CMDIChildWnd *m_pgotochildf=NULL;
	m_pgotochildf=nowchild;


		//获得双击行对应的搜索结果指针
//		inf_search=(SearchInf * )a_searchinfo.GetAt(n_selline-1);
		//获得双击行对应的子窗口指针
//	
		//获得子窗口活动视图
		CCrystalTextView* m_pexpandview=NULL; 
		m_pexpandview=(CCrystalTextView*)m_pgotochildf->GetActiveView();
	   CC02IDEView* m_peditview=(CC02IDEView*)m_pgotochildf->GetActiveView();
	   //如果子窗口存在
		if(m_pgotochildf!=NULL)
		{
			//子窗口激活
			m_pgotochildf->MDIActivate(); 
	        //子窗口设置为最前
		    m_pgotochildf->BringWindowToTop();
			//子窗口设置为焦点
			m_pgotochildf->SetFocus();
//	        //编辑控件的第一可见行
//			int nFirst = myeditctrl.GetFirstVisibleLine ();
			//查找结果所在行
//			int gotoline=inf_search->n_lineno;
            //查找结果所在列
			int gotorow=0;
			m_pexpandview->ScrollToLine(gotoline);
			//设置当前选择
			CPoint pselstart,pselend;
			pselstart.y=gotoline;
			pselstart.x=gotorow;
			pselend.y=gotoline;
			pselend.x=gotorow+findstring.GetLength();
			m_pexpandview->SetSelection(pselstart,pselend);
			m_pexpandview->SetCursorPos(pselend);
			m_pexpandview->EnsureVisible(pselend);
	        //子窗口激活
			m_pgotochildf->MDIActivate(); 
	        //子窗口设置为最前
		    m_pgotochildf->BringWindowToTop();
			//子窗口设置为焦点
			m_pgotochildf->SetFocus();
		}
	




}

⌨️ 快捷键说明

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