FileTransFrame.cpp
上传用户:maryhy001
上传日期:2007-05-02
资源大小:2317k
文件大小:2k
- // FileTransFrame.cpp : implementation file
- #include "stdafx.h"
- #include "trfAgent.h"
- #include "FileTransFrame.h"
- /////////////////////////////////////////////////////////////////////////////
- IMPLEMENT_DYNCREATE(CFileTransFrame, CFrameWnd)
- CFileTransFrame::CFileTransFrame()
- {
- }
- CFileTransFrame::~CFileTransFrame()
- {
- }
- BEGIN_MESSAGE_MAP(CFileTransFrame, CFrameWnd)
- //{{AFX_MSG_MAP(CFileTransFrame)
- //}}AFX_MSG_MAP
- END_MESSAGE_MAP()
- /////////////////////////////////////////////////////////////////////////////
- //switch view window.
- void CFileTransFrame::SwitchToView(UINT nView)
- {
- ASSERT(NULL != m_wndSpliter.GetSafeHwnd());
-
- switch(nView) {
- case 0:
- case 2:
- case 3:
- {
- m_wndSpliter.HideRow(1);
- }
- break;
- case 1:
- {
- m_wndSpliter.HideRow(0);
- }
- break;
- }
- }
- BOOL CFileTransFrame::OnCreateClient(LPCREATESTRUCT lpcs, CCreateContext* pContext)
- {
- ASSERT(pContext != NULL);
-
- //////////////////////////////////////////////////////////////////////////
-
- if(!m_wndSpliter.CreateStatic(this, 2, 1))
- {
- TRACE0("Failed to static create m_wndSpliter splitter windown");
- return FALSE;
- }
- if(!m_wndFleListSpliter.CreateStatic(&m_wndSpliter, 2, 1, WS_CHILD | WS_VISIBLE, m_wndSpliter.IdFromRowCol(0, 0)))
- {
- TRACE0("Failed to create send-recv list splitter windown");
- return -1;
- }
- if(!m_wndSpliter.CreateView(1, 0, RUNTIME_CLASS(CFileListRecv), CSize(0, 0), pContext))
- {
- TRACE0("Failed to create send-recv list splitter windown");
- return FALSE;
- }
-
- if(!m_wndFleListSpliter.CreateView(0, 0, RUNTIME_CLASS(CFileListSend), CSize(0, 130), pContext))
- {
- TRACE0("Failed to create send list view windown");
- return -1;
- }
- if(!m_wndFleListSpliter.CreateView(1, 0, RUNTIME_CLASS(CFileListRecv), CSize(0, 0), pContext))
- {
- TRACE0("Failed to create recv list view windown");
- return -1;
- }
- this->m_pwndFileSendList = (CFileListSend*)m_wndFleListSpliter.GetPane(0, 0); //send list window.
- this->m_pwndFileRecvList = (CFileListRecv*)m_wndFleListSpliter.GetPane(1, 0); //recv list window.
- this->m_pwndHistoryView = (CFileListRecv*)m_wndSpliter.GetPane(1, 0); //history list view.
- m_wndSpliter.HideRow(1);
- m_wndSpliter.RecalcLayout();
- return TRUE;
- }