📄 resultview.cpp
字号:
// ResultView.cpp : implementation file
//
#include "stdafx.h"
#include "ADOQry.h"
#include "ResultView.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CResultView
IMPLEMENT_DYNCREATE(CResultView, CRichEditView)
CResultView::CResultView()
{
// m_nWordWrap = AfxGetApp()->GetProfileInt(g_szResult, g_szResultWordWrap, WrapNone);
m_pGridCtrl = NULL;
}
CResultView::~CResultView()
{
}
BEGIN_MESSAGE_MAP(CResultView, CRichEditView)
//{{AFX_MSG_MAP(CResultView)
ON_WM_SIZE()
ON_WM_SETFOCUS()
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CResultView drawing
void CResultView::OnDraw(CDC* pDC)
{
CDocument* pDoc = GetDocument();
// TODO: add draw code here
}
/////////////////////////////////////////////////////////////////////////////
// CResultView diagnostics
#ifdef _DEBUG
void CResultView::AssertValid() const
{
CRichEditView::AssertValid();
}
void CResultView::Dump(CDumpContext& dc) const
{
CRichEditView::Dump(dc);
}
CADOQryDoc* CResultView::GetDocument() // non-debug version is inline
{
ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CADOQryDoc)));
return (CADOQryDoc*)m_pDocument;
}
#endif //_DEBUG
/////////////////////////////////////////////////////////////////////////////
// CResultView message handlers
void CResultView::OnInitialUpdate()
{
CRichEditView::OnInitialUpdate();
SetMargins(CRect(720, 720, 720, 720));
}
void CResultView::OnSize(UINT nType, int cx, int cy)
{
CRichEditView::OnSize(nType, cx, cy);
if(m_pGridCtrl != NULL && m_pGridCtrl->m_hWnd != NULL)
{
m_pGridCtrl->MoveWindow(0, 0, cx, cy);
m_pGridCtrl->Invalidate();
m_pGridCtrl->UpdateWindow();
Invalidate();
UpdateWindow();
}
}
int CResultView::OnMouseActivate(CWnd* pDesktopWnd, UINT nHitTest, UINT message)
{
const MSG* pMsg = GetCurrentMessage();
GetParent()->SendMessage(WM_MOUSEACTIVATE, pMsg->wParam, pMsg->lParam);
return CRichEditView::OnMouseActivate(pDesktopWnd, nHitTest, message);
}
void CResultView::OnSetFocus(CWnd* pOldWnd)
{
CRichEditView::OnSetFocus(pOldWnd);
bool bFocus = m_pGridCtrl && ::IsWindow(m_pGridCtrl->m_hWnd) &&
m_pGridCtrl->IsWindowVisible();
if(!bFocus)
CRichEditView::OnSetFocus(pOldWnd);
else
m_pGridCtrl->SetFocus();
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -