#ifndef _COMMON_ICONFRAME_HPP_ #define _COMMON_ICONFRAME_HPP_ #ifndef _COMMON_BLOCK_HPP_ #include #endif #ifndef _COMMON_PUREICON_HPP_ #include #endif #ifndef _COMMON_ICONBITMAP_HPP_ #include #endif class IconFrame : public Block { public: IconFrame(void); IconFrame(const IconFrame &someIconFrame); virtual ~IconFrame(); IconFrame &operator+=(const PureIcon &somePureIcon); IconFrame &operator=(const IconFrame &someIconFrame); WORD operator==(const IconFrame &someIconFrame)const; WORD drawIcon(PureDevice &somePureDevice,const Point &xyPoint); void remove(void); private: void drawFrame(PureDevice &displayDevice,IconBitmap &someIconBitmap,const Point &xyPoint); Point mCurrentPoint; WORD mCurrentFrame; PureBitmap mBitmapBkGnd; }; inline IconFrame::IconFrame(void) : mCurrentFrame(0) { } inline IconFrame::IconFrame(const IconFrame &someIconFrame) { *this=someIconFrame; } inline IconFrame::~IconFrame() { } inline IconFrame &IconFrame::operator+=(const PureIcon &somePureIcon) { if(somePureIcon.isOkay())insert(&IconBitmap(somePureIcon)); return *this; } inline IconFrame &IconFrame::operator=(const IconFrame &someIconFrame) { (Block&)*this=(Block&)someIconFrame; return *this; } inline WORD IconFrame::operator==(const IconFrame &someIconFrame)const { return (Block&)*this==(Block&)someIconFrame; } inline void IconFrame::remove(void) { Block::remove(); } inline WORD IconFrame::drawIcon(PureDevice &somePureDevice,const Point &xyPoint) { if(!size())return FALSE; if(mCurrentFrame>=size())mCurrentFrame=0; drawFrame(somePureDevice,operator[](mCurrentFrame),xyPoint); mCurrentFrame++; return TRUE; } #endif