myRect.cpp
资源名称:Shapes.zip [点击查看]
上传用户:wenshuihe
上传日期:2007-01-14
资源大小:10k
文件大小:1k
源码类别:
BREW编程
开发平台:
Visual C++
- // 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);
- }