PeersListCtrl.h
资源名称:GGBT.rar [点击查看]
上传用户:lds876
上传日期:2013-05-25
资源大小:567k
文件大小:3k
源码类别:
P2P编程
开发平台:
Visual C++
- #if !defined(AFX_PEERSLISTCTRL_H__E019D10C_4F57_45F5_8360_A5D212031356__INCLUDED_)
- #define AFX_PEERSLISTCTRL_H__E019D10C_4F57_45F5_8360_A5D212031356__INCLUDED_
- #if _MSC_VER > 1000
- #pragma once
- #endif // _MSC_VER > 1000
- // PeersListCtrl.h : header file
- //
- #include "ListCtrlBaseEx.h"
- #include "PeerInfo.h"
- class CFileDBItem;
- class CConncetionData;
- class CSetupRegister;
- class CMonitorWnd;
- /////////////////////////////////////////////////////////////////////////////
- // CPeersListCtrl window
- class CPeersListCtrl : public CListCtrlBaseEx // CListCtrl
- {
- // Construction
- public:
- CPeersListCtrl();
- // Attributes
- public:
- CPeerInfo m_PeerInfoWnd;
- // Operations
- public:
- BOOL CreateEx(CWnd *pParent, CRect rc, long lID, long lParam, CSetupRegister* pSetupRegister, CMonitorWnd* pMonitorWnd);
- void Monitor(CFileDBItem* pFileDBItem = 0);
- void ShowAllPeers(bool bRefreshInfo);
- void OnMenuItemPeerInfo(UINT uID, const CConncetionData& conData);
- // Overrides
- // ClassWizard generated virtual function overrides
- //{{AFX_VIRTUAL(CPeersListCtrl)
- //}}AFX_VIRTUAL
- // Implementation
- public:
- virtual ~CPeersListCtrl();
- // Generated message map functions
- protected:
- //{{AFX_MSG(CPeersListCtrl)
- afx_msg void OnContextMenu(CWnd* pWnd, CPoint point);
- afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
- afx_msg void OnDeleteitem(NMHDR* pNMHDR, LRESULT* pResult);
- afx_msg void OnSize(UINT nType, int cx, int cy);
- afx_msg void OnLButtonDblClk(UINT nFlags, CPoint point);
- afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
- //}}AFX_MSG
- // afx_msg void OnColumnclick(NMHDR* pNMHDR, LRESULT* pResult);
- afx_msg void OnCustomDraw(NMHDR* pNMHDR, LRESULT* pResult);
- afx_msg void OnMenuItemPeers(UINT uID);
- afx_msg void OnMenuitemCopy();
- afx_msg void OnMenuitemSelectAll();
- afx_msg void OnMenuitemMonitorSub(UINT uID);
- DECLARE_MESSAGE_MAP()
- private:
- static int CALLBACK Compare1(LPARAM lParam1, LPARAM lParam2, LPARAM lParamSort);
- void OnShowColumn(int iItem);
- void OnColumnSort(int iColumn);
- void RefreshPeerText(int iItem, CConncetionData& Conn);
- void _ShowAllPeers(bool bRefreshInfo);
- void ShowPeerText(int iItem);
- enum eColumns {eIcon, eIP, eLocale, eDownRate, eUpRate, eDownCount, eUpCount, eHave,
- eInterested, eChoking, eInteresting, eChocked, ePeersColumnCount};
- CImageList m_ctlImage;
- CFileDBItem* m_pFileDBItem;
- CSetupRegister* m_pSetupRegister;
- CMonitorWnd* m_pMonitorWnd;
- int m_iSortedCol;
- // bool m_bSortAscending;
- // int m_iSortedCol;
- int m_arrColType[ePeersColumnCount];
- /*
- enum ImageState{IID_UNCOMPLETE = 0, IID_COMPLETE, IID_DOWNLOAD, IID_UPLOAD,
- IID_DOWNLOAD_TRACKER, IID_UPLOAD_TRACKER, IID_DOWNLOAD_OTHERS, IID_UPLOAD_OTHERS,
- IID_DOWNLOAD_SEED, IID_UPLOAD_SEED, IID_BAD, IID_PREPARE, IID_PAUSE};
- //*/
- enum {IID_UPLOAD, IID_DOWNLOAD, IID_CONNECTING, IID_DELETE, IID_PAUSE};
- };
- /////////////////////////////////////////////////////////////////////////////
- //{{AFX_INSERT_LOCATION}}
- // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
- #endif // !defined(AFX_PEERSLISTCTRL_H__E019D10C_4F57_45F5_8360_A5D212031356__INCLUDED_)