?? textview.cpp
字號:
// TextView.cpp : implementation file
//
#include "stdafx.h"
#include "Exp33_1.h"
#include "exp33_1Doc.h"
#include "element.h"
#include "TextView.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CTextView
IMPLEMENT_DYNCREATE(CTextView, CView)
CTextView::CTextView()
{
}
CTextView::~CTextView()
{
}
BEGIN_MESSAGE_MAP(CTextView, CView)
//{{AFX_MSG_MAP(CTextView)
// NOTE - the ClassWizard will add and remove mapping macros here.
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CTextView drawing
void CTextView::OnDraw(CDC* pDC)
{
CExp33_1Doc* pDoc = (CExp33_1Doc*)GetDocument();
// TODO: add draw code here
POSITION pos;
TEXTMETRIC tm;
pDC->GetTextMetrics(&tm);
int cy,y = 0;
cy = tm.tmHeight;
CElement *elem;
pos = pDoc->m_elemList.GetHeadPosition();
while(pos!=NULL){ //畫出鏈表中所有圖形
elem = (CElement*)pDoc->m_elemList.GetAt(pos);
elem->Show(pDC,y);
pDoc->m_elemList.GetNext(pos);
y += cy;
}
}
/////////////////////////////////////////////////////////////////////////////
// CTextView diagnostics
#ifdef _DEBUG
void CTextView::AssertValid() const
{
CView::AssertValid();
}
void CTextView::Dump(CDumpContext& dc) const
{
CView::Dump(dc);
}
#endif //_DEBUG
/////////////////////////////////////////////////////////////////////////////
// CTextView message handlers
void CTextView::OnInitialUpdate()
{
CView::OnInitialUpdate();
// TODO: Add your specialized code here and/or call the base class
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -