-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathCtrlDownloadTip.h
112 lines (97 loc) · 2.86 KB
/
CtrlDownloadTip.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
//
// CtrlDownloadTip.h
//
// This file is part of PeerProject (peerproject.org) © 2008-2012
// Portions copyright Shareaza Development Team, 2002-2007.
//
// PeerProject is free software. You may redistribute and/or modify it
// under the terms of the GNU Affero General Public License
// as published by the Free Software Foundation (fsf.org);
// version 3 or later at your option. (AGPLv3)
//
// PeerProject is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
// See the GNU Affero General Public License 3.0 for details:
// (http://www.gnu.org/licenses/agpl.html)
//
#pragma once
#include "CtrlCoolTip.h"
class CPeerProjectFile;
class CDownload;
class CDownloadSource;
class CLineGraph;
class CGraphItem;
class CDownloadTipCtrl : public CCoolTipCtrl
{
DECLARE_DYNAMIC(CDownloadTipCtrl)
// Construction
public:
CDownloadTipCtrl();
virtual ~CDownloadTipCtrl();
public:
void Show(CDownload* pContext, HWND hAltWnd = NULL)
{
bool bChanged = ( pContext != m_pDownload );
m_pDownload = pContext;
m_pSource = NULL;
m_hAltWnd = hAltWnd;
ShowImpl( bChanged );
}
void Show(CDownloadSource* pContext, HWND hAltWnd = NULL)
{
bool bChanged = ( pContext != m_pSource );
m_pDownload = NULL;
m_pSource = pContext;
m_hAltWnd = hAltWnd;
ShowImpl( bChanged );
}
// Attributes
protected:
CDownload* m_pDownload;
CDownloadSource* m_pSource;
CString m_sName;
CString m_sSHA1;
CString m_sTiger;
CString m_sED2K;
CString m_sBTH;
CString m_sMD5;
CString m_sURL;
CString m_sSize;
CString m_sType;
CString m_sSeedsPeers;
CString m_sCountryName;
int m_nIcon;
int m_nHeaderWidth;
int m_nStatWidth;
CArray< CString > m_pHeaderName;
CArray< CString > m_pHeaderValue;
CLineGraph* m_pGraph;
CGraphItem* m_pItem;
BOOL m_bDrawGraph; // Draw the download graph?
// Operations
protected:
virtual BOOL OnPrepare();
virtual void OnCalcSize(CDC* pDC);
virtual void OnShow();
virtual void OnHide();
virtual void OnPaint(CDC* pDC);
void OnCalcSize(CDC* pDC, CDownload* pDownload);
void OnCalcSize(CDC* pDC, CDownloadSource* pSource);
void OnPaint(CDC* pDC, CDownload* pDownload);
void OnPaint(CDC* pDC, CDownloadSource* pSource);
void PrepareDownloadInfo(CDownload* pDownload);
void PrepareFileInfo(CDownload* pDownload); // CPeerProjectFile
void DrawProgressBar(CDC* pDC, CPoint* pPoint, CDownload* pDownload);
void DrawProgressBar(CDC* pDC, CPoint* pPoint, CDownloadSource* pSource);
// Overrides
//public:
//{{AFX_VIRTUAL(CDownloadTipCtrl)
//}}AFX_VIRTUAL
// Implementation
protected:
//{{AFX_MSG(CDownloadTipCtrl)
afx_msg void OnTimer(UINT_PTR nIDEvent);
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};