-
Notifications
You must be signed in to change notification settings - Fork 0
/
Downloads_InfoFrame.cpp
105 lines (73 loc) · 1.97 KB
/
Downloads_InfoFrame.cpp
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
/*
Free Download Manager Copyright (c) 2003-2014 FreeDownloadManager.ORG
*/
#include "stdafx.h"
#include "FdmApp.h"
#include "Downloads_InfoFrame.h"
#include "DownloadsWnd.h"
extern CDownloadsWnd* _pwndDownloads;
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
CDownloads_InfoFrame::CDownloads_InfoFrame()
{
m_pChild = NULL;
}
CDownloads_InfoFrame::~CDownloads_InfoFrame()
{
}
BEGIN_MESSAGE_MAP(CDownloads_InfoFrame, CWnd)
//{{AFX_MSG_MAP(CDownloads_InfoFrame)
ON_WM_PAINT()
ON_WM_SIZE()
ON_WM_ERASEBKGND()
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
BOOL CDownloads_InfoFrame::Create(CWnd *pParent)
{
CRect rc (0, 0, 50, 50);
if (FALSE == CWnd::Create (AfxRegisterWndClass (0, LoadCursor (NULL, IDC_ARROW),
(HBRUSH)(COLOR_3DFACE+1), NULL), NULL, WS_CHILD | WS_VISIBLE, rc, pParent, 0x121f))
return FALSE;
return TRUE;
}
void CDownloads_InfoFrame::OnPaint()
{
CPaintDC dc(this);
CRect rc;
GetClientRect (&rc);
CPen penLight (PS_SOLID, 1, GetSysColor (COLOR_3DHILIGHT));
CPen penShadow (PS_SOLID, 1, GetSysColor (COLOR_3DSHADOW));
CPen *oldPen = dc.SelectObject (&penLight);
dc.SelectObject (oldPen);
}
void CDownloads_InfoFrame::SetChildWnd(CWnd *pWnd)
{
m_pChild = pWnd;
CRect rc;
GetClientRect (&rc);
ResizeChild (rc.right, rc.bottom);
}
void CDownloads_InfoFrame::OnSize(UINT, int cx, int cy)
{
if (m_pChild)
ResizeChild (cx, cy);
}
void CDownloads_InfoFrame::ResizeChild(int cx, int cy)
{
if (cx > 5 && cy > 4)
m_pChild->MoveWindow (3, 3, cx - 5, cy - 4);
}
BOOL CDownloads_InfoFrame::OnEraseBkgnd(CDC* pDC)
{
if (_pwndDownloads->m_wndDownloads.m_info.m_video.m_wndVideo.m_player.Get_State () != VFPS_CLOSED)
{
CRect rc;
_pwndDownloads->m_wndDownloads.m_info.m_video.GetWindowRect(&rc);
ScreenToClient(&rc);
pDC->ExcludeClipRect(&rc);
}
return CWnd::OnEraseBkgnd(pDC);
}