00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #if !defined(AFX_LIVELIST_H__D1A833C9_1477_43C7_9644_DB0C85370511__INCLUDED_)
00023 #define AFX_LIVELIST_H__D1A833C9_1477_43C7_9644_DB0C85370511__INCLUDED_
00024
00025 #pragma once
00026
00027 class CLiveItem;
00028
00029
00030 class CLiveList
00031 {
00032
00033 public:
00034 CLiveList(int nColumns);
00035 virtual ~CLiveList();
00036
00037
00038 protected:
00039 int m_nColumns;
00040 CMap<DWORD, DWORD, CLiveItem*, CLiveItem*&> m_pItems;
00041 protected:
00042 static CBitmap m_bmSortAsc;
00043 static CBitmap m_bmSortDesc;
00044
00045
00046 public:
00047 CLiveItem* Add(DWORD nParam);
00048 CLiveItem* Add(LPVOID pParam);
00049 void Apply(CListCtrl* pCtrl, BOOL bSort = FALSE);
00050 protected:
00051 void Clear();
00052
00053
00054 public:
00055 static void Sort(CListCtrl* pCtrl, int nColumn = -1, BOOL bGraphic = TRUE);
00056 static int CALLBACK SortCallback(LPARAM lParam1, LPARAM lParam2, LPARAM lParamSort);
00057 static int SortProc(LPCTSTR sA, LPCTSTR sB, BOOL bNumeric = FALSE);
00058 static inline BOOL IsNumber(LPCTSTR pszString);
00059
00060
00061 public:
00062 static CImageList* CreateDragImage(CListCtrl* pList, const CPoint& ptMouse);
00063 static COLORREF crDrag;
00064
00065 };
00066
00067
00068 class CLiveItem
00069 {
00070
00071 public:
00072 CLiveItem(int nColumns, DWORD nParam);
00073 virtual ~CLiveItem();
00074
00075
00076 public:
00077 DWORD m_nParam;
00078 int m_nImage;
00079 UINT m_nMaskOverlay;
00080 UINT m_nMaskState;
00081 public:
00082 CString* m_pColumn;
00083
00084
00085 public:
00086 void Set(int nColumn, LPCTSTR pszText);
00087 void Format(int nColumn, LPCTSTR pszFormat, ...);
00088 public:
00089 int Add(CListCtrl* pCtrl, int nItem, int nColumns);
00090 BOOL Update(CListCtrl* pCtrl, int nItem, int nColumns);
00091
00092 };
00093
00094 #ifndef CDRF_NOTIFYSUBITEMDRAW
00095
00096 #define LVS_EX_NOHSCROLL 0x10000000
00097 #define LVS_EX_FLATSB 0x00000100
00098 #define LVS_EX_REGIONAL 0x00000200
00099 #define LVS_EX_INFOTIP 0x00000400
00100 #define LVS_EX_LABELTIP 0x00004000
00101 #define LVS_EX_UNDERLINEHOT 0x00000800
00102 #define LVS_EX_UNDERLINECOLD 0x00001000
00103 #define LVS_EX_MULTIWORKAREAS 0x00002000
00104
00105 #define CDRF_NOTIFYSUBITEMDRAW 0x00000020
00106 #define CDDS_SUBITEM 0x00020000
00107
00108 #define LVM_GETSUBITEMRECT (LVM_FIRST + 56)
00109 #define ListView_GetSubItemRect(hwnd, iItem, iSubItem, code, prc) \
00110 (BOOL)SNDMSG((hwnd), LVM_GETSUBITEMRECT, (WPARAM)(int)(iItem), \
00111 ((prc) ? ((((LPRECT)(prc))->top = iSubItem), (((LPRECT)(prc))->left = code), (LPARAM)(prc)) : (LPARAM)(LPRECT)NULL))
00112
00113
00114
00115
00116
00117
00118
00119
00120
00121
00122
00123
00124
00125
00126
00127 #endif
00128
00129 #endif // !defined(AFX_LIVELIST_H__D1A833C9_1477_43C7_9644_DB0C85370511__INCLUDED_)