#ifndef __RV_PUSH_BUTTON_H_INCLUDED_
#define __RV_PUSH_BUTTON_H_INCLUDED_

#include "reacx.h"


class REACX_API CPushButton :	public CReacter
{
public:
	//图像绘制	
	enum{
		PB_DEFAULT=0,
		PB_STRETCH,    //拉伸
		PB_FILLBOX,    //等比例拉伸
		PB_CENTER,    //居中
	};

	CPushButton(void);
	virtual ~CPushButton(void);


  
	virtual BOOL Serialize(HANDLE device, BOOL bIn ) ;
	virtual CUCObj* Clone( CUCObj* twin) ;
	virtual void Show(CDelegate* pDelegate,int mode, BOOL bForced );
	
	void LoadImages(const TCHAR* strFileNormal, const TCHAR* strFileMouseIn, const TCHAR* strFileDown, const TCHAR* strFileDisable);
	
	void SetImages(const RvImage imNor, const RvImage imIn, const RvImage imDown, const RvImage imDis);
public:
	RvColor m_backColorNor;
	RvColor m_backColorDis;
	RvColor m_backColorDown;
	RvColor m_backColorIn;
  

	CUtString  m_strCaption;
	int        m_nImageStyle;
	BOOL       m_bClassical;
	 
//window message
public:
	virtual void OnMouseEnter();
	virtual void OnMouseLeave();

	virtual void OnSetFocus();
	virtual void OnKillFocus();
	  
	virtual void OnLButtonDown(WPARAM wParam, LPARAM lParam);
	virtual void OnLButtonUp(WPARAM wParam, LPARAM lParam);

protected:
	 void DrawInRuntime(CDelegate* pDelegate, BOOL bForce  );
	 void DrawInEdition(CDelegate* pDelegate, BOOL bForce  ); 

	 void DestroyAllImages();

protected:
	RvImage m_imNormal;   //默认情况下
	RvImage m_imMouseIn;  //鼠标在窗口中间
	RvImage m_imDown;     //鼠标按下
	RvImage m_imDisable;  //禁用

 
};


#endif