www.pudn.com > Jx_KClustering.rar > PicButton.h


#pragma once 
#include "stdafx.h" 
 
// PicButton 图片按钮 
 
class PicButton : public CButton 
{ 
	DECLARE_DYNAMIC(PicButton) 
protected: 
	// 按钮的状态 
	BOOL m_bOver;		// 鼠标位于按钮之上时该值为true,反之为flase 
	BOOL m_bTracking;	// 在鼠标按下没有释放时该值为true 
	BOOL m_bSelected;	// 按钮被按下是该值为true 
 
	// 按钮图素 
	CBitmap m_imgNormal; 
	CBitmap m_imgOver; 
	CBitmap m_imgSelected; 
 
public: 
	PicButton(); 
	virtual ~PicButton(); 
 
protected: 
	DECLARE_MESSAGE_MAP() 
public: 
	// 载入图片 
	void LoadImages(UINT nIDnormal, UINT nIDover, UINT nIDseleted); 
	virtual void DrawItem(LPDRAWITEMSTRUCT /*lpDrawItemStruct*/); 
	afx_msg void OnMouseMove(UINT nFlags, CPoint point); 
	afx_msg LRESULT OnMouseLeave(WPARAM wParam, LPARAM lParam); 
	afx_msg LRESULT OnMouseHover(WPARAM wParam, LPARAM lParam); 
	afx_msg BOOL OnEraseBkgnd(CDC* pDC); 
protected: 
	virtual void PreSubclassWindow(); 
public: 
	afx_msg void OnLButtonDown(UINT nFlags, CPoint point); 
	afx_msg void OnLButtonUp(UINT nFlags, CPoint point); 
public: 
	afx_msg void OnLButtonDblClk(UINT nFlags, CPoint point); 
};