www.pudn.com > CbuttonListBoxDemo.zip > LedButton.h


#if !defined(AFX_LEDBUTTON_H__A004BE86_6661_442A_9255_93EB9C69D819__INCLUDED_) 
#define AFX_LEDBUTTON_H__A004BE86_6661_442A_9255_93EB9C69D819__INCLUDED_ 
 
#if _MSC_VER > 1000 
#pragma once 
#endif // _MSC_VER > 1000 
// LedButton.h : header file 
// 
 
///////////////////////////////////////////////////////////////////////////// 
// CLedButton window 
 
#include "Led.h" 
 
#define LEDLEFTOFFSET	2 
#define UM_BUTTON_CLICK	WM_USER+1000 
 
class CLedButton : public CButton 
{ 
// Construction 
public: 
	CLed* GetLed()									{return &m_Led;} 
	void SetTextColour(COLORREF		TxtColour)		{m_TextColour = TxtColour;} 
	void SetButtonColour(COLORREF	ButtonColour)	{m_ButtonColour = ButtonColour;} 
	CWnd* GetParent()								{return m_pParent;} 
	void CentreLED(); 
	CLedButton(CString ButtonText,CWnd* Parent); 
	CString GetButtonText()							{return m_ButtonText;} 
 
// Attributes 
private: 
	CRect		m_LEDLocation; 
	COLORREF	m_TextColour; 
	COLORREF	m_ButtonColour; 
	CWnd*		m_pParent; 
	CString		m_ButtonText; 
 
// Operations 
public: 
 
// Overrides 
	// ClassWizard generated virtual function overrides 
	//{{AFX_VIRTUAL(CLedButton) 
	public: 
	virtual void DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct); 
	//}}AFX_VIRTUAL 
 
// Implementation 
public: 
	virtual ~CLedButton(); 
 
	// Generated message map functions 
protected: 
	//{{AFX_MSG(CLedButton) 
	afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct); 
	afx_msg void OnClicked(); 
	//}}AFX_MSG 
	 
	CLed m_Led; 
	BOOL CreateLED(); 
 
	DECLARE_MESSAGE_MAP() 
}; 
 
///////////////////////////////////////////////////////////////////////////// 
 
//{{AFX_INSERT_LOCATION}} 
// Microsoft Visual C++ will insert additional declarations immediately before the previous line. 
 
#endif // !defined(AFX_LEDBUTTON_H__A004BE86_6661_442A_9255_93EB9C69D819__INCLUDED_)