📄 mygraphview.cpp
字号:
// MyGraphView.cpp : implementation file
//
#include "stdafx.h"
#include "MyEdit.h"
#include "MyEditDoc.h"
#include "MyGraphView.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CMyGraphView
IMPLEMENT_DYNCREATE(CMyGraphView, CView)
CMyGraphView::CMyGraphView()
{
}
CMyGraphView::~CMyGraphView()
{
}
BEGIN_MESSAGE_MAP(CMyGraphView, CView)
//{{AFX_MSG_MAP(CMyGraphView)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CMyGraphView drawing
void CMyGraphView::OnDraw(CDC* pDC)
{
CMyEditDoc* pDoc = GetDocument();
ASSERT_VALID(pDoc);
// TODO: add draw code here
m_text=pDoc->textBuf;
int tp=1;
for(int i=1;i<=100;i++)
{
if(m_text[0]>>7==0)
{
pDC->MoveTo(tp,tp+9);
pDC->LineTo(tp+i*10,tp+9);
}
}
}
/////////////////////////////////////////////////////////////////////////////
// CMyGraphView diagnostics
#ifdef _DEBUG
void CMyGraphView::AssertValid() const
{
CView::AssertValid();
}
void CMyGraphView::Dump(CDumpContext& dc) const
{
CView::Dump(dc);
}
//////////////////////////////////////////////////////////// 多加的 ///////////////////////////////////////
CMyEditDoc* CMyGraphView::GetDocument() // non-debug version is inline
{
ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CMyEditDoc)));
return (CMyEditDoc*)m_pDocument;
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
#endif //_DEBUG
/////////////////////////////////////////////////////////////////////////////
// CMyGraphView message handlers
BOOL CMyGraphView::PreCreateWindow(CREATESTRUCT& cs)
{
// cs.style|=( WS_HSCROLL|WS_VSCROLL );
return CView::PreCreateWindow(cs);
}
void CMyGraphView::SetText(unsigned long len)
{
m_CharCount=len;
m_Rows=m_CharCount/100;
// m_LineHeight=16;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -