?? screenview.cpp
字號:
// screenView.cpp : implementation of the CScreenView class
//
#include "stdafx.h"
#include "screen.h"
#include "MainFrm.h"
#include "screenDoc.h"
#include "screenView.h"
#include "FullScreenHandler.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CScreenView
IMPLEMENT_DYNCREATE(CScreenView, CFormView)
BEGIN_MESSAGE_MAP(CScreenView, CFormView)
//{{AFX_MSG_MAP(CScreenView)
ON_WM_KEYDOWN()
//}}AFX_MSG_MAP
// Standard printing commands
ON_COMMAND(ID_FILE_PRINT, CFormView::OnFilePrint)
ON_COMMAND(ID_FILE_PRINT_DIRECT, CFormView::OnFilePrint)
ON_COMMAND(ID_FILE_PRINT_PREVIEW, CFormView::OnFilePrintPreview)
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CScreenView construction/destruction
CScreenView::CScreenView()
: CFormView(CScreenView::IDD)
{
//{{AFX_DATA_INIT(CScreenView)
// NOTE: the ClassWizard will add member initialization here
//}}AFX_DATA_INIT
// TODO: add construction code here
}
CScreenView::~CScreenView()
{
}
void CScreenView::DoDataExchange(CDataExchange* pDX)
{
CFormView::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CScreenView)
// NOTE: the ClassWizard will add DDX and DDV calls here
//}}AFX_DATA_MAP
}
BOOL CScreenView::PreCreateWindow(CREATESTRUCT& cs)
{
// TODO: Modify the Window class or styles here by modifying
// the CREATESTRUCT cs
return CFormView::PreCreateWindow(cs);
}
void CScreenView::OnInitialUpdate()
{
CFormView::OnInitialUpdate();
GetParentFrame()->RecalcLayout();
ResizeParentToFit();
}
/////////////////////////////////////////////////////////////////////////////
// CScreenView printing
BOOL CScreenView::OnPreparePrinting(CPrintInfo* pInfo)
{
// default preparation
return DoPreparePrinting(pInfo);
}
void CScreenView::OnBeginPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
{
// TODO: add extra initialization before printing
}
void CScreenView::OnEndPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
{
// TODO: add cleanup after printing
}
void CScreenView::OnPrint(CDC* pDC, CPrintInfo* /*pInfo*/)
{
// TODO: add customized printing code here
}
/////////////////////////////////////////////////////////////////////////////
// CScreenView diagnostics
#ifdef _DEBUG
void CScreenView::AssertValid() const
{
CFormView::AssertValid();
}
void CScreenView::Dump(CDumpContext& dc) const
{
CFormView::Dump(dc);
}
CScreenDoc* CScreenView::GetDocument() // non-debug version is inline
{
ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CScreenDoc)));
return (CScreenDoc*)m_pDocument;
}
#endif //_DEBUG
/////////////////////////////////////////////////////////////////////////////
// CScreenView message handlers
void CScreenView::OnDraw(CDC* pDC)
{
// TODO: Add your specialized code here and/or call the base class
CRect rc;
GetClientRect(&rc);
pDC->DrawText(FullScreenHandler.InFullScreenMode() ?
_T("恢復窗口按ESC") : _T(""), &rc, 0);
}
void CScreenView::OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags)
{
// TODO: Add your message handler code here and/or call default
if(nChar==VK_ESCAPE) // 如果按的鍵為Esc鍵
{// 獲取主框架窗口的指針
CMainFrame *pFrame =(CMainFrame*)AfxGetApp()->m_pMainWnd;
//調用主窗口類的自定義函數 EndFullScreen ,便可退出全屏顯示狀態
pFrame->Recover();
}
CFormView::OnKeyDown(nChar, nRepCnt, nFlags);
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -