📄 codemanagerview.cpp
字号:
// CodeManagerView.cpp : implementation of the CCodeManagerView class
//
#include "stdafx.h"
#include "CodeManager.h"
#include "CodeManagerDoc.h"
#include "CntrItem.h"
#include "CodeManagerView.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CCodeManagerView
IMPLEMENT_DYNCREATE(CCodeManagerView, CSynEditView)
BEGIN_MESSAGE_MAP(CCodeManagerView, CSynEditView)
//{{AFX_MSG_MAP(CCodeManagerView)
ON_WM_DESTROY()
ON_WM_RBUTTONDOWN()
//}}AFX_MSG_MAP
// Standard printing commands
ON_COMMAND(ID_FILE_PRINT, CSynEditView::OnFilePrint)
ON_COMMAND(ID_FILE_PRINT_DIRECT, CSynEditView::OnFilePrint)
ON_COMMAND(ID_FILE_PRINT_PREVIEW, CSynEditView::OnFilePrintPreview)
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CCodeManagerView construction/destruction
CCodeManagerView::CCodeManagerView()
{
// TODO: add construction code here
}
CCodeManagerView::~CCodeManagerView()
{
}
BOOL CCodeManagerView::PreCreateWindow(CREATESTRUCT& cs)
{
// TODO: Modify the Window class or styles here by modifying
// the CREATESTRUCT cs
return CSynEditView::PreCreateWindow(cs);
}
void CCodeManagerView::OnInitialUpdate()
{
CSynEditView::OnInitialUpdate();
// Set the printing margins (720 twips = 1/2 inch).
SetMargins(CRect(720, 720, 720, 720));
}
/////////////////////////////////////////////////////////////////////////////
// CCodeManagerView printing
BOOL CCodeManagerView::OnPreparePrinting(CPrintInfo* pInfo)
{
// default preparation
return DoPreparePrinting(pInfo);
}
void CCodeManagerView::OnDestroy()
{
// Deactivate the item on destruction; this is important
// when a splitter view is being used.
COleClientItem* pActiveItem = GetDocument()->GetInPlaceActiveItem(this);
if (pActiveItem != NULL && pActiveItem->GetActiveView() == this)
{
pActiveItem->Deactivate();
ASSERT(GetDocument()->GetInPlaceActiveItem(this) == NULL);
}
CSynEditView::OnDestroy();
}
/////////////////////////////////////////////////////////////////////////////
// CCodeManagerView diagnostics
#ifdef _DEBUG
void CCodeManagerView::AssertValid() const
{
CSynEditView::AssertValid();
}
void CCodeManagerView::Dump(CDumpContext& dc) const
{
CSynEditView::Dump(dc);
}
CCodeManagerDoc* CCodeManagerView::GetDocument() // non-debug version is inline
{
ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CCodeManagerDoc)));
return (CCodeManagerDoc*)m_pDocument;
}
#endif //_DEBUG
/////////////////////////////////////////////////////////////////////////////
// CCodeManagerView message handlers
void CCodeManagerView::OnRButtonDown(UINT nFlags, CPoint point)
{
// TODO: Add your message handler code here and/or call default
POINT ptCursor;
::GetCursorPos(&ptCursor);
CMenu menu;
VERIFY(menu.LoadMenu(IDR_MAINFRAME));
CMenu* pPopup = menu.GetSubMenu(1);
ASSERT(pPopup != NULL);
CWnd* pWndPopupOwner = this;
while (pWndPopupOwner->GetStyle() & WS_CHILD)
pWndPopupOwner = pWndPopupOwner->GetParent();
pPopup->TrackPopupMenu(TPM_LEFTALIGN | TPM_RIGHTBUTTON, ptCursor.x, ptCursor.y,
pWndPopupOwner);
CSynEditView::OnRButtonDown(nFlags, point);
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -