www.pudn.com > CbuttonListBoxDemo.zip > ButtonListBox.h
#if !defined(AFX_BUTTONLISTBOX_H__10063853_6CA3_40C2_8B5E_289233B8F489__INCLUDED_)
#define AFX_BUTTONLISTBOX_H__10063853_6CA3_40C2_8B5E_289233B8F489__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// ButtonListBox.h : header file
//
/////////////////////////////////////////////////////////////////////////////
// CButtonListBox window
#include "Afxtempl.h"
#include "LedButton.h"
#define NUMBER_OF_BUTTONS_IN_LIST_VIEW 10 // List box will hold 10 buttons before scroll bars are needed
class CButtonListBox : public CListBox
{
// Construction
public:
CButtonListBox();
void AddItem(LPCTSTR ButtonText);
// Attributes
private:
CArray m_ButtonArray;
// Operations
public:
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CButtonListBox)
public:
virtual BOOL PreTranslateMessage(MSG* pMsg);
protected:
virtual void PreSubclassWindow();
//}}AFX_VIRTUAL
// Implementation
public:
virtual ~CButtonListBox();
// Generated message map functions
protected:
//{{AFX_MSG(CButtonListBox)
afx_msg void DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct);
afx_msg BOOL OnEraseBkgnd(CDC* pDC);
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
/////////////////////////////////////////////////////////////////////////////
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_BUTTONLISTBOX_H__10063853_6CA3_40C2_8B5E_289233B8F489__INCLUDED_)