?? rectangle.cpp
字號:
// Rectangle.cpp: implementation of the CRectangle class.
//
//////////////////////////////////////////////////////////////////////
#include "stdafx.h"
#include "cad.h"
#include "Rectangle.h"
#include<afxtempl.h>
#ifdef _DEBUG
#undef THIS_FILE
static char THIS_FILE[]=__FILE__;
#define new DEBUG_NEW
#endif
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
IMPLEMENT_SERIAL(CRectangle,CObject,1)
CRectangle::CRectangle()
{
m_status=3;
m_next=3;
}
CRectangle::~CRectangle()
{
}
void CRectangle::Serialize(CArchive &ar)
{
if(ar.IsStoring()) ar<<m_pt1<<m_pt2<<m_next<<m_status;
else ar>>m_pt1>>m_pt2>>m_next>>m_status;
}
bool CRectangle::IsEmpty()
{
if(m_pt1.x==m_pt2.x==m_pt1.y==m_pt2.y==0)
return TRUE;
else return FALSE;
}
void CRectangle::Empty()
{
m_pt1.x=m_pt2.x=m_pt1.y=m_pt2.y=0;
}
int CRectangle::GetStatus()
{
return m_status;
}
void CRectangle::DrawRectangle(CDC *pdc)
{
pdc->Rectangle(m_pt1.x,m_pt1.y,m_pt2.x,m_pt2.y);
}
CRectangle::CRectangle(CPoint pt1, CPoint pt2)
{
m_status=3;
m_pt1=pt1;
m_pt2=pt2;
m_next=3;
}
void CRectangle::SetNext(int i)
{
m_next=i;
}
int CRectangle::GetNext()
{
return m_next;
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -