#ifndef __SHAPE_EX_H_INCLUDED_
#define __SHAPE_EX_H_INCLUDED_


#include "shpset.h"

class SHPSET_API CShapeEx : public CIndicater
{
public:
	CShapeEx(void);
	virtual ~CShapeEx(void);

	enum SHAPE_TYPE{
		//ST_DEFAULT =-1,       //矩形
	
		ST_RECT = 0,		 	// 方框
		ST_CIRCLE ,				// 圆

		ST_ROUND_RECT,			// 圆角矩形
		ST_HEART  ,			   // 心形1
		ST_HEART2,				// 心形2
		
		ST_RHOMBUS_DIALOG,		// 椭圆形对话框
		ST_CLOUD_DIALOG,			// 云朵型对话框
		ST_RECT_DIALOG,			// 矩形对话框
				
		ST_RHOMBUS,				// 菱形
		ST_TRIANGLE,			// 三角形

		ST_LEFT_ARROW,			// 左箭头
		ST_RIGHT_ARROW,			// 右箭头
		ST_RIGHT_ARROW2,		// 右箭头2
		ST_HALF_STADIUM,		// 半个体育场
		ST_PLUS,				// 十字形

		ST_OCTAGON,				// 八边形 
		ST_PENTANGLE,			// 五角星
		ST_EIGHT_ANGLE,			// 八角星

		ST_WAVE,				// 波浪
		ST_FLOWER,				// 花状
		ST_SPADE,				// 黑桃
		ST_PLUM,				// 梅花
		ST_LEAF,				// 叶子
	};

	enum BRUSH_TYPE{
	     BT_SOLID = RV_BT_SOLID ,
         BT_BDIAD = RV_BT_BDIAG ,
         BT_CROSS = RV_BT_CROSS ,
         BT_DIAGCROSS = RV_BT_DIAGCROSS,
         BT_FDIALG = RV_BT_FDIAG ,
         BT_HORI   = RV_BT_HORI ,
         BT_VERT   = RV_BT_VERT  ,
         BT_DOT    = RV_BT_DOT   ,
	};

	enum DISPLAY_STYLE{
	    DS_DEFAULT =0,
		DS_FILLOUT, //填充显示
		DS_PICTURE, //显示原始图像
		DS_TEXTURE, //显示图像纹理
		DS_ECLOSE,  //羽化显示图像
	};

	virtual BOOL Serialize(HANDLE device, BOOL bIn ) ;

	virtual void Show(CDelegate* pDelegate, int mode, BOOL bForced);	
	virtual CUCObj* Clone(  CUCObj *twin);
	
	virtual BOOL  Create(/*CDelegate* pDelegate=NULL,*/ const TCHAR* strName = NULL, UINT id =-1, int style = RV_UC_DEFAULT_STYLE ) ;


	int  GetShapeType() { return m_shapeType; };
	void SetShapeType(CShapeEx::SHAPE_TYPE type);


	int GetDisplayStyle();
	virtual void SetDisplayStyle(DISPLAY_STYLE style);
	 
	//virtual void SetClientRect(int x, int y, int w, int h);
	virtual void   SetCtrlRect(int left, int top, UINT width, UINT height) ;

	RvMask GetMask(){ return m_shapeMask; };

	void SetImage(const RvImage image, BOOL bKeepMask=FALSE, int filter = RV_FM_BILINEAR);

	void UpdateMask(BOOL bKeepImage=FALSE);

	void SetBrushType(BRUSH_TYPE type);
	int  GetBrushType() { return m_brushType; };

	void SetText(const char* strText);
	const char*  GetText();

//	GRgb    GetBorderColor(){ return m_borderColor;};
//	virtual void  SetBorderColor(GRgb& val);
public:
	virtual void OnEndTrack(CDelegate* pDelegate,HGPD hCur,  GPoint point, int nHitTest) ;
	 

protected:
//	GRgb m_borderColor;
	CUtString m_strText;  //文字
private:
	HANDLE DrawBorder(HGDC dc, HANDLE hStroke);

	void UpdateShapeMask(int type);

	 void Eclose(RvImage imMask, int radius);
	 
	RvMask  m_shapeMask;
	//RvMask  m_borderMask;

	RvImage m_image;
	RvImage m_imShow;
	//RvImage m_imBorder;

	int m_displayStyle;
	int m_brushType;
	int m_shapeType; 

};








#endif  //ENDIF OF __SHAPE_H_INCLUDED_

