www.pudn.com > CraftFTP_gb.rar > ContainView.cpp
// ContainView.cpp : implementation file
//
#include "stdafx.h"
#include "MainFrm.h"
#include "CraftFTP.h"
#include "LocalView.h"
#include "RemoteView.h"
#include "ContainView.h"
#include "ProcessCtrl.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CContainView
IMPLEMENT_DYNCREATE(CContainView, CView)
CContainView::CContainView()
{
}
CContainView::~CContainView()
{
}
BEGIN_MESSAGE_MAP(CContainView, CView)
//{{AFX_MSG_MAP(CContainView)
ON_WM_CREATE()
ON_WM_SIZE()
ON_WM_SETFOCUS()
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CContainView drawing
void CContainView::OnDraw(CDC* pDC)
{
CDocument* pDoc = GetDocument();
// TODO: add draw code here
}
/////////////////////////////////////////////////////////////////////////////
// CContainView diagnostics
#ifdef _DEBUG
void CContainView::AssertValid() const
{
CView::AssertValid();
}
void CContainView::Dump(CDumpContext& dc) const
{
CView::Dump(dc);
}
#endif //_DEBUG
/////////////////////////////////////////////////////////////////////////////
// CContainView message handlers
int CContainView::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
if (CView::OnCreate(lpCreateStruct) == -1)
return -1;
// TODO: Add your specialized creation code here
const DWORD dwStyle = WS_CHILD|WS_VISIBLE|WS_BORDER|WS_VSCROLL|LVS_REPORT|LVS_SINGLESEL;
m_TaskListCtrl.Create (dwStyle, CRect(0,0,0,0), this, 1);
m_TaskListCtrl.SendMessage (LVM_SETEXTENDEDLISTVIEWSTYLE, 0, LVS_EX_FULLROWSELECT);
m_TaskListCtrl.SubclassHeader(FALSE);
return 0;
}
void CContainView::OnSize(UINT nType, int cx, int cy)
{
CView::OnSize(nType, cx, cy);
// TODO: Add your message handler code here
if(m_TaskListCtrl.GetSafeHwnd())
m_TaskListCtrl.MoveWindow(-1,-1,cx+1,cy+2);
}
void CContainView::OnSetFocus(CWnd* pOldWnd)
{
CView::OnSetFocus(pOldWnd);
// TODO: Add your message handler code here
CMainFrame * pFrame = (CMainFrame*)AfxGetApp()->m_pMainWnd;
CLocalView * pLocalView = pFrame->GetLocalView();
CRemoteView * pRemoteView = pFrame->GetRemoteView();
if(pLocalView->GetSafeHwnd())
{
pLocalView->GetCaptionBar()->SetActiveCaption(FALSE);
pLocalView->SetFocus(FALSE);
}
if(pRemoteView->GetSafeHwnd())
{
pRemoteView->GetCaptionBar()->SetActiveCaption(FALSE);
pLocalView->SetFocus(FALSE);
}
}