www.pudn.com > ListCtrl2014.rar > XKListCtrl.h, change:2014-05-09,size:2290b


#pragma once 
 
#include "ListEdit.h" 
 
typedef BOOL (*FunCanEditFilter)(int nRow, int nCol);  
typedef BOOL (*FunDataFilter)(CString &strData);  
 
class CXKListCtrl : public CListCtrl 
{ 
	DECLARE_DYNAMIC(CXKListCtrl) 
 
public: 
	CXKListCtrl(); 
	virtual ~CXKListCtrl(); 
 
	static BOOL DefCanEditFilter(int nRow, int nCol); //单元格是否可编辑的默认过滤器 
 
	static BOOL DefDataFilter(CString &strData); //单元格编辑后数据是否更新到单元格的默认过滤器 
 
	void SetCanEditFilter(FunCanEditFilter fnComp); 
 
	void EnableEdiable(BOOL bEditable = TRUE); 
 
	DWORD SetExtendedStyle(DWORD dwNewStyle); 
 
	void SetLinkListCtrl(CXKListCtrl *pListCtrl); 
 
	void SetColorInfo(COLORREF colorText, COLORREF colorBk, COLORREF colorSelText,  
		COLORREF colorSelBk, COLORREF colorEditText, COLORREF colorEditBk); 
 
	BOOL DeleteColumn(int nCol); 
 
	BOOL DeleteAllItems(); 
 
	int InsertColumn(int nCol, LPCTSTR lpszColumnHeading, int nFormat = LVCFMT_LEFT,  
		int nWidth = -1, int nSubItem = -1); 
 
	int InsertItem(int nItem, LPCTSTR lpszItem); 
 
	int SetItemText(int nItem, int nSubItem, LPCTSTR lpszText); 
 
	CString GetItemText(int nItem, int nSubItem); 
 
	BOOL SetItemState(int nItem, UINT nState, UINT nMask); 
 
	BOOL DisposeEdit(); 
 
	void ShowEdit(); 
 
	//{{AFX_VIRTUAL(CXKListCtrl) 
	virtual BOOL PreTranslateMessage(MSG* pMsg); 
	virtual void PreSubclassWindow(); 
	//}}AFX_VIRTUAL 
 
protected: 
	//{{AFX_MSG(CXKListCtrl) 
	afx_msg void OnColumnclick(NMHDR* pNMHDR, LRESULT* pResult); 
	afx_msg void OnLButtonDown(UINT nFlags, CPoint point); 
	afx_msg void OnLButtonDblClk(UINT nFlags, CPoint point); 
	afx_msg void OnNMClickList(NMHDR *pNMHDR, LRESULT *pResult); 
	afx_msg void OnNMCustomdrawList(NMHDR *pNMHDR, LRESULT *pResult); 
	afx_msg void OnNMKillfocusList(NMHDR *pNMHDR, LRESULT *pResult); 
	//}}AFX_MSG 
	DECLARE_MESSAGE_MAP() 
 
protected: 
	void SetRadioSelect(int nSelItem); //设置单选 
 
	void SetMultiSelect(int nSelItem); //设置多选 
 
public: 
	BOOL m_fAsc;//是否顺序排序 
	int m_nSortedCol;//当前排序的列 
 
protected: 
	int m_nEditRow; 
	int m_nEditCol; 
	 
	BOOL m_bEditable; //单元格是否可编辑 
 
	FunCanEditFilter m_fnCanEditFilter; 
	FunDataFilter m_fnDataFilter; 
 
	COLORREF m_colorUnits[6]; 
 
	CListEdit m_editUnit; 
	CXKListCtrl *m_pLinkListCtrl; 
};