PeerInfo.h
资源名称:GGBT.rar [点击查看]
上传用户:lds876
上传日期:2013-05-25
资源大小:567k
文件大小:3k
源码类别:
P2P编程
开发平台:
Visual C++
- #if !defined(AFX_PEERINFO_H__B39B7FFA_B663_45D9_A3D3_E8A0AC305800__INCLUDED_)
- #define AFX_PEERINFO_H__B39B7FFA_B663_45D9_A3D3_E8A0AC305800__INCLUDED_
- #if _MSC_VER > 1000
- #pragma once
- #endif // _MSC_VER > 1000
- // PeerInfo.h : header file
- //
- #include "DownloaderFeedback.h"
- #include "GraphHaveData.h"
- #include "IPLocater.h"
- #include "ScrollWndbase.h"
- class CPeersListCtrl;
- /////////////////////////////////////////////////////////////////////////////
- // CPeerInfo window
- class CPeerInfo : public CScrollWndbase
- {
- // Construction
- public:
- CPeerInfo();
- // Attributes
- public:
- CConncetionData m_conData;
- // Operations
- public:
- BOOL CreateEx(CWnd* pParent, CRect rc, CPeersListCtrl * pPeersListCtrl, long lID, long lParam);
- void ClosePeer();
- // Overrides
- // ClassWizard generated virtual function overrides
- //{{AFX_VIRTUAL(CPeerInfo)
- //}}AFX_VIRTUAL
- // Implementation
- public:
- void ShowPeer(const CConncetionData& conData);
- bool IsMonitoring();
- virtual ~CPeerInfo();
- // Generated message map functions
- protected:
- //{{AFX_MSG(CPeerInfo)
- afx_msg void OnPaint();
- afx_msg void OnLButtonDblClk(UINT nFlags, CPoint point);
- afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
- afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
- afx_msg BOOL OnEraseBkgnd(CDC* pDC);
- afx_msg void OnContextMenu(CWnd* pWnd, CPoint point);
- afx_msg void OnRButtonDown(UINT nFlags, CPoint point);
- //}}AFX_MSG
- void OnMenuItemPeers(UINT uID);
- DECLARE_MESSAGE_MAP()
- private:
- void OnScrollEx();
- void EraseBk(CDC & dc, CRect rc);
- void DrawItem(CDC & dc, bool bPart = false);
- void DrawFace(COLORREF Top, COLORREF Bottom, CRect& rc, CRect CalRc, CDC* pDC);
- static CString GetDefaultModulePath();
- void PaintSpeedGraph(CDC& dc, CRect rc, bool bShowText);
- long GetMaxValue(long lValue[], long lCount);
- void DrawLine(long lValue[], CDC& dc, COLORREF cor, CRect& rc, long lMax, long iVisibleCount);
- enum {eAddr, ePeerId, eDownRate, eUpRate, eDownCount, eState, eSpeed, eHaves, eInterested, eInteresting, eAllCount};
- bool m_bRefreshItem[eAllCount];
- long m_lGridWidth;
- CFont m_font;
- CGraphHaveData m_graphHaveData;
- CString m_strIPName;
- CIPLocater m_IPLocator;
- CPeersListCtrl* m_pPeersListCtrl;
- bool m_bAbort;
- bool m_bMonitoring;
- };
- /////////////////////////////////////////////////////////////////////////////
- //{{AFX_INSERT_LOCATION}}
- // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
- #endif // !defined(AFX_PEERINFO_H__B39B7FFA_B663_45D9_A3D3_E8A0AC305800__INCLUDED_)