12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788 |
- #ifndef __NAVLISTCTRL__
- #define __NAVLISTCTRL__
- #if _MSC_VER > 1000
- #pragma once
- #endif // _MSC_VER > 1000
- #include <deque>
- #include <atlimage.h>
- #include "EnBitmap.h"
- /////////////////////////////////////////////////////////////////////////////
- // CNavListCtrl window
- struct LUSERITEM
- {
- CString szUserID;
- CString szUserName;
- CString szIPAddress;
- CString szServerAddress;
- CString szNoticeMsg;
- BOOL bOnline;
- int nHeadImageIndex;
- };
- typedef std::deque<LUSERITEM> DEQUELVITEM;
- class CNavListCtrl : public CListCtrl
- {
- // Construction
- public:
- CNavListCtrl();
- enum {
- TVS_CAMERA = 1 << 0,
- TVS_EMAIL = 1 << 1,
- TVS_MOBILE = 1 << 2,
- TVS_ONLINEUSER = 1 << 3
- };
- // Attributes
- public:
- COLORREF m_crHighlight;
- COLORREF m_crHighlightBorder;
- COLORREF m_crHover;
- CEnBitmap m_bitmap;
- // Operations
- public:
- void SetBackBitmap(LPCTSTR lpszImage) {};
- int InsertItem(int nItem, LPCTSTR szItemText, int nImageIndex, LUSERITEM* UserInfo = NULL);
- BOOL GetUserItemInfo(LPCTSTR szItemText, LUSERITEM* userInfo);
- CRect GetTailIconRect(int nItem, DWORD dwServeFlag);
- // Implementation
- public:
- virtual ~CNavListCtrl();
- int m_nHighlight;
- virtual void DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct);
- // Generated message map functions
- protected:
- //{{AFX_MSG(CNavListCtrl)
- afx_msg void OnNcCalcSize(BOOL bCalcValidRects, NCCALCSIZE_PARAMS FAR* lpncsp);
- afx_msg void OnMouseMove(UINT nFlags, CPoint point);
- afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
- afx_msg void MeasureItem(LPMEASUREITEMSTRUCT lpMeasureItemStruct);
- //}}AFX_MSG
- afx_msg void OnNMCustomdraw(NMHDR* pNMHDR, LRESULT* pResult);
- afx_msg void OnSize(UINT nType, int cx, int cy);
- DECLARE_MESSAGE_MAP()
- private:
- DEQUELVITEM m_DequeList;
- HICON m_hTailIconCamera;
- HICON m_hTailIconEmail;
- HICON m_hTailIconMobile;
- CEnBitmap m_bmpItemSelected;
- CEnBitmap m_bmpFaceBG;
- int nHoverItem;
- int nLastHoverItem;
- public:
- afx_msg BOOL OnEraseBkgnd(CDC* pDC);
- afx_msg void OnPaint();
- afx_msg void OnTimer(UINT_PTR nIDEvent);
- };
- #endif
|