📄 line.cpp
字号:
// Line.cpp : implementation file
//
#include "stdafx.h"
#include "Sketch.h"
#include "Line.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CLine
IMPLEMENT_SERIAL (CLine, CCmdTarget, 1)
CLine::CLine()
{
}
CLine::CLine (POINT from, POINT to)
{
m_ptFrom = from;
m_ptTo = to;
}
CLine::~CLine()
{
}
BEGIN_MESSAGE_MAP(CLine, CCmdTarget)
//{{AFX_MSG_MAP(CLine)
// NOTE - the ClassWizard will add and remove mapping macros here.
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CLine message handlers
void CLine::Serialize(CArchive& ar)
{
if (ar.IsStoring())
{
ar << m_ptFrom << m_ptTo;
}
else
{
ar >> m_ptFrom >> m_ptTo;
}
}
void CLine::Draw(CDC *pDC)
{
pDC->SelectStockObject (BLACK_PEN);
pDC->MoveTo (m_ptFrom);
pDC->LineTo (m_ptTo);
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -