📄 view2.cpp
字号:
// View2.cpp : implementation file
//
#include "stdafx.h"
#include "MultiScreen.h"
#include "View2.h"
#include "mainfrm.h"
#include "resource.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CView2
IMPLEMENT_DYNCREATE(CView2, CFormView)
CView2::CView2()
: CFormView(CView2::IDD)
{
//{{AFX_DATA_INIT(CView2)
// NOTE: the ClassWizard will add member initialization here
//}}AFX_DATA_INIT
}
CView2::~CView2()
{
}
void CView2::DoDataExchange(CDataExchange* pDX)
{
CFormView::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CView2)
// NOTE: the ClassWizard will add DDX and DDV calls here
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CView2, CFormView)
ON_WM_CONTEXTMENU()
//{{AFX_MSG_MAP(CView2)
ON_WM_PAINT()
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CView2 diagnostics
#ifdef _DEBUG
void CView2::AssertValid() const
{
CFormView::AssertValid();
}
void CView2::Dump(CDumpContext& dc) const
{
CFormView::Dump(dc);
}
#endif //_DEBUG
/////////////////////////////////////////////////////////////////////////////
// CView2 message handlers
void CView2::OnContextMenu(CWnd*, CPoint point)
{
// CG: This block was added by the Pop-up Menu component { if (point.x == -1 && point.y == -1){ //keystroke invocation CRect rect; GetClientRect(rect); ClientToScreen(rect); point = rect.TopLeft(); point.Offset(5, 5); } CMenu menu; VERIFY(menu.LoadMenu(CG_IDR_POPUP_VIEW2)); CMenu* pPopup = menu.GetSubMenu(0); ASSERT(pPopup != NULL); CWnd* pWndPopupOwner = this; while (pWndPopupOwner->GetStyle() & WS_CHILD) pWndPopupOwner = pWndPopupOwner->GetParent(); pPopup->TrackPopupMenu(TPM_LEFTALIGN | TPM_RIGHTBUTTON, point.x, point.y, pWndPopupOwner); }
}
void CView2::OnPaint()
{
CPaintDC dc(this); // device context for painting
CMainFrame* pFrame=(CMainFrame*) AfxGetMainWnd();
pFrame->SetWindowText("View 2");
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -