00001
00002
00003
00004
00005
00006 #include "stdafx.h"
00007 #include "FdmApp.h"
00008 #include "Downloads_InfoFrame.h"
00009 #include "DownloadsWnd.h"
00010
00011 extern CDownloadsWnd* _pwndDownloads;
00012
00013 #ifdef _DEBUG
00014 #define new DEBUG_NEW
00015 #undef THIS_FILE
00016 static char THIS_FILE[] = __FILE__;
00017 #endif
00018
00019 CDownloads_InfoFrame::CDownloads_InfoFrame()
00020 {
00021 m_pChild = NULL;
00022 }
00023
00024 CDownloads_InfoFrame::~CDownloads_InfoFrame()
00025 {
00026 }
00027
00028 BEGIN_MESSAGE_MAP(CDownloads_InfoFrame, CWnd)
00029
00030 ON_WM_PAINT()
00031 ON_WM_SIZE()
00032 ON_WM_ERASEBKGND()
00033
00034 END_MESSAGE_MAP()
00035
00036 BOOL CDownloads_InfoFrame::Create(CWnd *pParent)
00037 {
00038 CRect rc (0, 0, 50, 50);
00039
00040 if (FALSE == CWnd::Create (AfxRegisterWndClass (0, LoadCursor (NULL, IDC_ARROW),
00041 (HBRUSH)(COLOR_3DFACE+1), NULL), NULL, WS_CHILD | WS_VISIBLE, rc, pParent, 0x121f))
00042 return FALSE;
00043
00044 return TRUE;
00045 }
00046
00047 void CDownloads_InfoFrame::OnPaint()
00048 {
00049 CPaintDC dc(this);
00050
00051 CRect rc;
00052 GetClientRect (&rc);
00053
00054 CPen penLight (PS_SOLID, 1, GetSysColor (COLOR_3DHILIGHT));
00055 CPen penShadow (PS_SOLID, 1, GetSysColor (COLOR_3DSHADOW));
00056
00057 CPen *oldPen = dc.SelectObject (&penLight);
00058
00059 dc.SelectObject (oldPen);
00060 }
00061
00062 void CDownloads_InfoFrame::SetChildWnd(CWnd *pWnd)
00063 {
00064 m_pChild = pWnd;
00065
00066 CRect rc;
00067 GetClientRect (&rc);
00068 ResizeChild (rc.right, rc.bottom);
00069 }
00070
00071 void CDownloads_InfoFrame::OnSize(UINT, int cx, int cy)
00072 {
00073 if (m_pChild)
00074 ResizeChild (cx, cy);
00075 }
00076
00077 void CDownloads_InfoFrame::ResizeChild(int cx, int cy)
00078 {
00079 if (cx > 5 && cy > 4)
00080 m_pChild->MoveWindow (3, 3, cx - 5, cy - 4);
00081 }
00082
00083 BOOL CDownloads_InfoFrame::OnEraseBkgnd(CDC* pDC)
00084 {
00085
00086 if (_pwndDownloads->m_wndDownloads.m_info.m_video.m_wndVideo.m_player.Get_State () != VFPS_CLOSED)
00087 {
00088 CRect rc;
00089
00090 _pwndDownloads->m_wndDownloads.m_info.m_video.GetWindowRect(&rc);
00091 ScreenToClient(&rc);
00092
00093 pDC->ExcludeClipRect(&rc);
00094 }
00095
00096 return CWnd::OnEraseBkgnd(pDC);
00097 }