#if !defined(AFX_MYFOURBUTTON_H__A14FFAA6_3677_432B_9EFD_5632B75599A4__INCLUDED_)
#define AFX_MYFOURBUTTON_H__A14FFAA6_3677_432B_9EFD_5632B75599A4__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// MyFourButton.h : header file
//

/////////////////////////////////////////////////////////////////////////////
// CMyFourButton window

typedef void (CALLBACK* HJ_BTNMouseEvent)(UINT ID,UINT MouesEven,UINT nFlag,void *pParentWnd,CPoint point);
#define MOUSE_ENVENT(m_nID,event,nFlags,m_pWnd,point) \
	if(m_MouseEvent) m_MouseEvent(m_nID,event,nFlags,m_pWnd,point);
#define DEL_BMPOBJECT(bmp) if(bmp) {DeleteObject(bmp); bmp = NULL;}
#define TRANPTZ_LEFT_COLOR	RGB(255,0,255)
#define MOUSE_LEFT_DOWN		1	
#define MOUSE_LEFT_UP		2	
#define MOUSE_LEFT_MOVE		3
#define MOUSE_LEFT_DOUBLE	4	
#define MOUSE_RIGHT_DOWN	5	
#define MOUSE_RIGHT_UP		6	
#define MOUSE_RIGHT_MOVE    7
#define MOUSE_RIGHT_DOUBLE	8	

class CMyFourButton : public CWnd
{
// Construction
public:
	CMyFourButton();

// Attributes
public:
	void SetPosition(int x,int y);
	void SetShowCursor(HCURSOR cursor) {m_hCursor = cursor;}
	BOOL Create(UINT ID,CWnd *pParentWnd,HJ_BTNMouseEvent pMouseEvent);
	BOOL LoadBitmaps(LPCTSTR lpnomal, LPCTSTR lpdown = NULL, LPCTSTR lpfocus = NULL, LPCTSTR lpdis = NULL);
	BOOL LoadBitmaps(UINT nnomalID, UINT ndownID = 0, UINT nfocusID = 0, UINT ndisID = 0);
    BOOL LoadBitmaps(LPCTSTR lpnomal, LPCTSTR lpdown, LPCTSTR lpfocus, LPCTSTR lpdis,int width,int height);
    BOOL LoadBitmaps(int width,int height,UINT nnomalID, UINT ndownID = 0, UINT nfocusID = 0, UINT ndisID = 0);
	BOOL SetupRegionBitmap(LPCTSTR lpregion);
	void SetState(int state);
	int  GetState() {return m_state;}
	void UpdateTipTool(LPCTSTR string);
// Operations
public:

// Overrides
	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CMyFourButton)
	//}}AFX_VIRTUAL

// Implementation
public:
	virtual ~CMyFourButton();

	// Generated message map functions
protected:
	HCURSOR				m_hCursor;
	UINT				m_nID;
	CWnd*				m_pWnd;
	HBITMAP	m_hBitmap,m_hBitmapdown,m_hbitmapfocus,m_hbitmapdis;
	int					m_nWidth, m_nHeight;
	UINT				m_pos, m_oldpos;
	BOOL				m_bIn;
	BOOL                m_bCapture;
	HJ_BTNMouseEvent    m_MouseEvent;
	int					m_state;
	//{{AFX_MSG(CMyFourButton)
	afx_msg void OnPaint();
	afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
	afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
	afx_msg void OnMouseMove(UINT nFlags, CPoint point);
	afx_msg void OnEnable(BOOL bEnable);
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()

protected:
	CToolTipCtrl	m_tooltip;
	void            RelayEvent(UINT message, WPARAM wParam, LPARAM lParam);
};

/////////////////////////////////////////////////////////////////////////////

//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.

#endif // !defined(AFX_MYFOURBUTTON_H__A14FFAA6_3677_432B_9EFD_5632B75599A4__INCLUDED_)
