/* ========================================================================== * ÀÛ ¼º ÀÚ : À̼ø±Ô * ÀÛ ¼º ÀÏ : 2006.09.20 * ³» ¿ë : »ö »óÀÚ * ÁÖÀÇ»çÇ× : *===========================================================================*/ #pragma once class cColorBoxGroup; /// »ö »óÀÚ class cColorBox : public CButton { friend class cColorBoxGroup; public: cColorBox(); virtual ~cColorBox(); /// ±×·ìÀ» ¼³Á¤ void SetGroup( cColorBoxGroup* group ); /// »öÀ» ¼³Á¤ void SetColor( COLORREF color ); /// »öÀ» ¸®ÅÏ COLORREF GetColor() const; /// üũ ¿©ºÎ void SetChecked( bool checked ); bool IsChecked() const; public: virtual void DrawItem( LPDRAWITEMSTRUCT ds ); protected: 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 ); afx_msg void OnLButtonDblClk( UINT flags, CPoint point ); afx_msg void OnRButtonDown( UINT flags, CPoint point ); DECLARE_MESSAGE_MAP() protected: /// ±×·ì cColorBoxGroup* mGroup; /// ±×·ì ³»ºÎ À妽º unsigned int mIndex; /// üũ ¿©ºÎ bool mChecked; /// »ö COLORREF mColor; }; inline void cColorBox::SetColor( COLORREF color ) { mColor = color; Invalidate( FALSE ); } inline COLORREF cColorBox::GetColor() const { return mColor; } inline bool cColorBox::IsChecked() const { return mChecked; }