#if !defined(AFX_BITBUTTON_H)
#define AFX_BITBUTTON_H

#if _MSC_VER >= 1000
#pragma once
#endif // _MSC_VER >= 1000
#include "mcimp3.h"
#include "volumcontrol.h"
//DrawBitmap flags;
#define	DB_HCENTER	0x0001L
#define DB_VCENTER	0x0002L

class CBitButton : public CButton
{
// Construction
public:
	CBitButton();
	int statflag;
// Attributes
public:
	typedef enum TextAlign {AlignLeft=0,AlignRight,AlignBelow,AlignAbove};
// Operations
public:

// Overrides
	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(TrackLookButton)
	public:
	virtual void DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct);
	//}}AFX_VIRTUAL
	void	OnMouseEnter(UINT nFlags,CPoint point);
	void	OnMouseLeave(UINT nFlags,CPoint point);

// Implementation
public:
	BOOL LoadBitmaps(CString szBitmap,CString szBitmapFocus="",\
		CString szBitmapDisabled="",CString szBitmapOther="",\
		CString szBitmapDown="",CString szBitmapFocus2="",\
		CString szBitmapDown2="");
	
	BOOL LoadBitmaps(LPCSTR lpszBitmap,LPCSTR lpszBitmapFocus=NULL,\
		LPCSTR lpszBitmapDisabled=NULL,LPCSTR lpszBitmapOther=NULL,\
		LPCSTR lpszBitmapDown=NULL,LPCSTR lpszBitmapFocus2=NULL,\
		LPCSTR lpszBitmapDown2=NULL);
	void SetTextAlignment(TextAlign nTextAlign);
	TextAlign GetTextAlignment() const;
	BOOL		m_bHasChanged;
	BOOL		m_bPlay;
	BOOL		m_bDown;
	DWORD		m_lVol,m_rVol;
	BOOL		m_musicplaying;
	BOOL LoadBitmaps(UINT nBitmap,UINT nBitmapFocus=0, UINT nBitmapDisabled=0,\
		UINT nBitmapOther=0,UINT nBitmapDown=0,UINT nBitmapFocus2=0,UINT nBitmapDown2=0);
	virtual ~CBitButton();

	// Generated message map functions
protected:
	BOOL m_bRaised;
	
	int k;
	BOOL m_muteflag;
	void DrawBitmap(CDC* pDC,CRect rc,UINT nFlags,CBitmap* pBitmap);
	CBitmap m_bitmap;
	CBitmap m_bitmapFocus;
	CBitmap m_bitmapDisabled;
	CBitmap m_bitmapRaised;
	CBitmap m_bitmapOther;
	CBitmap m_bitmapDown;
	CBitmap m_bitmapDown2;//use to make play button
	CBitmap m_bitmapFocus2;//use to make play button
	CVolumControl m_MuteControl;
	TextAlign	m_TextAlign;
	BOOL		m_bDisabled;
	BOOL		m_bHasFocus;
	
	
	void Draw3DBorder(CDC* pDC,CRect rc,UINT nOptions);
	
	BOOL		m_bLButtonDown;
	UINT		m_nBorder;
	BOOL		m_bMouseCaptured;
	//{{AFX_MSG(TrackLookButton)
	afx_msg void OnMouseMove(UINT nFlags, CPoint point);
	afx_msg void OnKillFocus(CWnd* pNewWnd);
	afx_msg void OnSetFocus(CWnd* pOldWnd);
	afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
	afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
	afx_msg void OnLButtonDblClk(UINT nFlags, CPoint point);
	afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
	afx_msg void OnEnable(BOOL bEnable);
	afx_msg BOOL OnEraseBkgnd(CDC* pDC);
	
	
	//}}AFX_MSG

	DECLARE_MESSAGE_MAP()
};

#endif
