00001
00002
00003
00004
00005
00006 #include "stdafx.h"
00007 #include "FdmApp.h"
00008 #include "ChildView.h"
00009 #include "plugincmds.h"
00010 #include "DownloadsWnd.h"
00011
00012 extern CDownloadsWnd* _pwndDownloads;
00013
00014 #ifdef _DEBUG
00015 #define new DEBUG_NEW
00016 #undef THIS_FILE
00017 static char THIS_FILE[] = __FILE__;
00018 #endif
00019
00020 extern fsPluginMgr _PluginMgr;
00021
00022 IMPLEMENT_DYNAMIC(CChildView, CWnd)
00023
00024 CChildView::CChildView()
00025 {
00026 }
00027
00028 CChildView::~CChildView()
00029 {
00030 }
00031
00032 BEGIN_MESSAGE_MAP(CChildView,CWnd )
00033
00034 ON_WM_PAINT()
00035 ON_WM_SIZE()
00036 ON_WM_CREATE()
00037 ON_WM_SETFOCUS()
00038 ON_WM_ERASEBKGND()
00039
00040 ON_COMMAND_RANGE (WGP_MENU_CMDFIRST, WGP_MENU_CMDLAST, OnPluginCommand)
00041 ON_UPDATE_COMMAND_UI_RANGE (WGP_MENU_CMDFIRST, WGP_MENU_VIEWSMPLITEM_CMDSTART-1, OnUpdatePluginCommand)
00042 END_MESSAGE_MAP()
00043
00044 BOOL CChildView::PreCreateWindow(CREATESTRUCT& cs)
00045 {
00046 if (!CWnd::PreCreateWindow(cs))
00047 return FALSE;
00048
00049 cs.dwExStyle = 0;
00050 cs.style &= ~WS_BORDER;
00051 cs.lpszClass = AfxRegisterWndClass(CS_HREDRAW|CS_VREDRAW|CS_DBLCLKS,
00052 ::LoadCursor(NULL, IDC_ARROW), HBRUSH(COLOR_BTNFACE+1), NULL);
00053
00054 return TRUE;
00055 }
00056
00057 void CChildView::OnPaint()
00058 {
00059 CPaintDC dc(this);
00060
00061 CRect rc;
00062 GetClientRect (&rc);
00063 }
00064
00065 void CChildView::OnSize(UINT, int cx, int cy)
00066 {
00067 m_wndClient.MoveWindow (0, 3, cx, cy-3, TRUE);
00068 }
00069
00070 int CChildView::OnCreate(LPCREATESTRUCT lpCreateStruct)
00071 {
00072 if (CWnd ::OnCreate(lpCreateStruct) == -1)
00073 return -1;
00074
00075 if (FALSE == m_wndClient.Create (this))
00076 return -1;
00077
00078 return 0;
00079 }
00080
00081 void CChildView::OnPluginCommand(UINT uCmd)
00082 {
00083 m_wndClient.m_plugs2.SendPluginCommand (uCmd);
00084 }
00085
00086 void CChildView::OnUpdatePluginCommand(CCmdUI *pCmdUI)
00087 {
00088
00089 int state = _PluginMgr.OnUpdateToolBar (pCmdUI->m_nID);
00090
00091 pCmdUI->Enable ((state & WGP_CMDITEMSTATE_DISABLED) == 0);
00092 pCmdUI->SetCheck (state & WGP_CMDITEMSTATE_CHECKED ? 1 : 0);
00093 }
00094
00095 void CChildView::OnSetFocus(CWnd* pOldWnd)
00096 {
00097 CWnd ::OnSetFocus(pOldWnd);
00098 m_wndClient.SetFocus ();
00099 }
00100
00101 BOOL CChildView::OnEraseBkgnd(CDC* pDC)
00102 {
00103
00104 if (_pwndDownloads->m_wndDownloads.m_info.m_video.m_wndVideo.m_player.Get_State () != VFPS_CLOSED)
00105 {
00106 CRect rc;
00107
00108 _pwndDownloads->m_wndDownloads.m_info.m_video.GetWindowRect(&rc);
00109 ScreenToClient(&rc);
00110
00111 pDC->ExcludeClipRect(&rc);
00112 }
00113
00114 return CWnd ::OnEraseBkgnd(pDC);
00115 }