?? tabview2.cpp
字號:
// viewTwo.cpp : implementation file
//
#include "stdafx.h"
#include "tab.h"
#include "TabDoc.h"
#include "TabView2.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CTabView2
IMPLEMENT_DYNCREATE(CTabView2, CView)
CTabView2::CTabView2()
{
}
CTabView2::~CTabView2()
{
}
BEGIN_MESSAGE_MAP(CTabView2, CView)
//{{AFX_MSG_MAP(CTabView2)
ON_WM_TIMER()
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
void CTabView2::OnDraw(CDC* pDC)
{
//設置字體
CFont fnt;
LOGFONT fl;
memset(&fl , 0 ,sizeof(LOGFONT));
fl.lfHeight = 30;
fl.lfWidth = 15;
fl.lfWeight =500;
fnt.CreateFontIndirect(&fl);
CFont *pOldFont = pDC->SelectObject( &fnt );
pDC->TextOut(30,40,"This is CView2 derived from CView");
pDC->SelectObject( pOldFont );
}
/////////////////////////////////////////////////////////////////////////////
// CTabView2 diagnostics
#ifdef _DEBUG
void CTabView2::AssertValid() const
{
CView::AssertValid();
}
void CTabView2::Dump(CDumpContext& dc) const
{
CView::Dump(dc);
}
#endif //_DEBUG
/////////////////////////////////////////////////////////////////////////////
// CTabView2 message handlers
void CTabView2::OnInitialUpdate()
{
CView::OnInitialUpdate();
// TODO: Add your specialized code here and/or call the base class
SetTimer(2,500,NULL);
}
void CTabView2::OnTimer(UINT nIDEvent)
{
if(nIDEvent==2)
{
m_Increase=((CTabDoc*)GetDocument())->m_Accumulater++;
CString str;
str.Format("Counter : %d",m_Increase);
CDC *pDC=GetDC();
pDC->TextOut(200,100,str,str.GetLength());
}
CView::OnTimer(nIDEvent);
}
BOOL CTabView2::DestroyWindow()
{
// TODO: Add your specialized code here and/or call the base class
KillTimer(2);
return CView::DestroyWindow();
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -