www.pudn.com > CListCtrlTest.rar > MyListCtrl.h


#if !defined(AFX_MYLISTCTRL_H__C94B99D4_3062_4449_B14E_A17B9FEE96B6__INCLUDED_) 
#define AFX_MYLISTCTRL_H__C94B99D4_3062_4449_B14E_A17B9FEE96B6__INCLUDED_ 
 
#if _MSC_VER > 1000 
#pragma once 
#endif // _MSC_VER > 1000 
// MyListCtrl.h : header file 
// 
#include "MyStorgeImg.h"  //包含存储数据类 
#include "MyStorgeText.h" 
///////////////////////////////////////////////////////////////////////////// 
// CMyListCtrl window 
 
class CMyListCtrl : public CListCtrl 
{ 
// Construction 
public: 
	CMyListCtrl(); 
 
// Attributes 
public: 
 
// Operations 
public: 
 
// Overrides 
	// ClassWizard generated virtual function overrides 
	//{{AFX_VIRTUAL(CMyListCtrl) 
	//}}AFX_VIRTUAL 
 
// Implementation 
public: 
	virtual ~CMyListCtrl(); 
 
	// Generated message map functions 
protected: 
	//{{AFX_MSG(CMyListCtrl) 
	afx_msg void OnDestroy(); 
	afx_msg void OnPaint(); 
	//}}AFX_MSG 
 
	DECLARE_MESSAGE_MAP() 
public: 
	int AddImgInfo(char * filepath, const int & nitem, const int &subitem,  bool flag); //数据信息增加到CPtrArray中 
	//COLORREF rc, bool ImpView = false 文字底色是否突出显示,COLORREF 显示颜色 
	int AddTextInfo(const CString &str, const int & nitem, const int &subitem, const CRect & textrect, bool flag, COLORREF rc = RGB(255, 255, 255), bool ImpView = false); //文字信息增加CPtrArray中 
	//得到输出文字的矩形区域;[out]rect, [in]str, [in]flag, true表示文字在图标之前,false文字图标后 
	//[in]nitem, [in]subitem 行,列 
	//返回值true为正确 
	bool GetDrawTextRect(CRect * rect, const CString & str,  int nitem, int subitem, bool flag = true); 
	void * ShowImage(const char * filepath, int nitem, int subitem, bool flag = true);//增加图片 
	bool SetBkColorEx(COLORREF cr );  //设置背景色 
	bool SetTextColorEx(COLORREF cr); //设置文字颜色 
	void SetGridPro(bool GridPro);    //true有网阁属性 
	void  SetColumnCount(int count);   //设置列数 在需要画网格的时候必须调用 
	bool SetGridColorEx(COLORREF cr);  //设置网格线颜色 
 
private: 
	CPtrArray m_pArrayImg;     //图片信息数组 
	CPtrArray m_pArrayText; //文字信息数组 
	COLORREF m_bkColor;    //背景颜色 
	COLORREF m_TextColor;  //文字颜色   
	bool     m_bGridPro;   //网格属性 默认为false 
	int      m_ColumnCount; //列数   此变量是为画网格服务的 
	COLORREF m_GridColor;   //网格线的颜色  RGB(128, 128, 128)默认 
	CImageList m_ImageList; //调整栏高度 
}; 
 
///////////////////////////////////////////////////////////////////////////// 
 
//{{AFX_INSERT_LOCATION}} 
// Microsoft Visual C++ will insert additional declarations immediately before the previous line. 
 
#endif // !defined(AFX_MYLISTCTRL_H__C94B99D4_3062_4449_B14E_A17B9FEE96B6__INCLUDED_)