📄 myrect.cpp
字号:
// Rect.cpp: implementation of the CRect class.
//
//////////////////////////////////////////////////////////////////////
#include "myRect.h"
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
CRect::CRect()
{
}
CRect::~CRect()
{
}
boolean CRect::draw(IGraphics *pg)
{
boolean rval;
AEERect r;
r.x = m_ulc.getx();
r.y = m_ulc.gety();
r.dx = m_lrc.getx() - r.x;
r.dy = m_lrc.gety() - r.y;
rval = (IGRAPHICS_DrawRect(pg, &r) == SUCCESS);
return rval;
}
CRect::CRect(int16 x, int16 y, int16 dx, int16 dy, RGBVAL col): CShape(CColor(col)),
m_ulc(x,y), m_lrc(x+dx, y+dy)
{
}
CRect::CRect(CPoint ulc, CPoint lrc, RGBVAL col): CShape(CColor(col)), m_ulc(ulc), m_lrc(lrc)
{
}
void* CRect::operator new(size_t sz)
{
return MALLOC(sz);
}
void CRect::operator delete(void *p)
{
FREE(p);
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -