// FCool.h
//

#if !defined(_COOLBUTTON_H_)
#define _COOLBUTTON_H_

class CCoolButton  : public CButton
{


private:

	enum ButtonStatus {NORMAL,HOVER,DOWN};
	
	ButtonStatus m_Status, m_PrevStatus;

	CCoolButton();

	void SetStatus(ButtonStatus bs);
	BOOL OnEraseBkgnd(CDC* pDC);
	
	int normalBmpId_;
	int hoverBmpId_;
	int downBmpId_;

public:
	CCoolButton(int nIDNormal, int nIDHover, int nIDDown);

	virtual void DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct);
	virtual void SetBitmaps(int nIDNormal, int nIDHover, int nIDDown);

	void AutoSize();

protected:

	BOOL IsInRect(CRect &rect, CPoint &point);

	void OnLButtonDblClk(UINT nFlags, CPoint point);
	void OnLButtonUp(UINT nFlags, CPoint point);
	void OnLButtonDown(UINT nFlags, CPoint point);
	void OnMouseMove(UINT nFlags, CPoint point);
	LRESULT OnMouseLeave(WPARAM wParam, LPARAM lParam);
	BOOL OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message );

	DECLARE_MESSAGE_MAP()
};

#endif //!defined(_COOLBUTTON_H_)