/* ========================================================================== * ÀÛ ¼º ÀÚ : À̼ø±Ô * ÀÛ ¼º ÀÏ : 2007.09.11 * ³» ¿ë : À̹ÌÁö ¹öư * ÁÖÀÇ»çÇ× : *===========================================================================*/ #pragma once class cImageButtonGroup; /// À̹ÌÁö ¹öư class cImageButton : public CButton { friend class cImageButtonGroup; public: cImageButton(); virtual ~cImageButton(); /// ±×·ìÀ» ¼³Á¤ void SetGroup( cImageButtonGroup* group ); /// À̹ÌÁö¸¦ ¼³Á¤ void SetImage( CBitmap* bitmap, unsigned int width, unsigned int height ); /// üũ ¿©ºÎ void SetCheckEnabled( bool enabled ); void SetChecked( bool checked ); bool IsChecked() const; protected: virtual void DrawItem( LPDRAWITEMSTRUCT ds ); protected: void DrawImage( CDC* dc, LPDRAWITEMSTRUCT ds ); void DrawFrame( CDC* dc, LPDRAWITEMSTRUCT ds ); void DrawBorder( CDC* dc, LPDRAWITEMSTRUCT ds ); protected: afx_msg BOOL OnEraseBkgnd( CDC* dc ); afx_msg void OnLButtonDown( UINT flags, CPoint point ); DECLARE_MESSAGE_MAP() protected: /// ±×·ì cImageButtonGroup* mGroup; /// ±×·ì ³»ºÎ À妽º unsigned int mIndex; /// üũ ¿©ºÎ bool mCheckEnabled; bool mChecked; /// À̹ÌÁö CBitmap* mBitmap; int mBitmapWidth; int mBitmapHeight; }; inline void cImageButton::SetCheckEnabled( bool enabled ) { mCheckEnabled = enabled; } inline bool cImageButton::IsChecked() const { return mChecked; }