FileTransView.cpp
上传用户:maryhy001
上传日期:2007-05-02
资源大小:2317k
文件大小:2k
- // FileTransView.cpp : implementation file
- #include "stdafx.h"
- #include "trfAgent.h"
- #include "FileTransView.h"
- // CFileTransView
- IMPLEMENT_DYNCREATE(CFileTransView, CView)
- CFileTransView::CFileTransView(){}
- CFileTransView::~CFileTransView(){}
- BEGIN_MESSAGE_MAP(CFileTransView, CView)
- //{{AFX_MSG_MAP(CFileTransView)
- ON_WM_CREATE()
- ON_WM_SIZE()
- //}}AFX_MSG_MAP
- END_MESSAGE_MAP()
- void CFileTransView::OnDraw(CDC* pDC)
- {
- CDocument* pDoc = GetDocument();
- // TODO: add draw code here
- }
- // CFileTransView diagnostics
- #ifdef _DEBUG
- void CFileTransView::AssertValid() const
- {
- CView::AssertValid();
- }
- void CFileTransView::Dump(CDumpContext& dc) const
- {
- CView::Dump(dc);
- }
- #endif //_DEBUG
- /////////////////////////////////////////////////////////////////////////////
- int CFileTransView::OnCreate(LPCREATESTRUCT lpCreateStruct)
- {
- if (CView::OnCreate(lpCreateStruct) == -1)
- return -1;
-
- if(!m_wndFleListSpliter.CreateStatic(this, 2, 1))
- {
- TRACE0("Failed to create send-recv list splitter windown");
- return -1;
- }
-
- CCreateContext *pContext = (CCreateContext*) lpCreateStruct->lpCreateParams;
-
- if(!m_wndFleListSpliter.CreateView(0, 0, RUNTIME_CLASS(CFileListSend), CSize(0, 200), 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;
- }
-
- m_pwndFileSendList = (CFileListSend*)m_wndFleListSpliter.GetPane(0, 0); //send list window.
- m_pwndFileRecvList = (CFileListRecv*)m_wndFleListSpliter.GetPane(1, 0); //recv list window.
- m_wndFleListSpliter.SetActivePane(0, 0);
- return 0;
- }
- void CFileTransView::OnSize(UINT nType, int cx, int cy)
- {
- CView::OnSize(nType, cx, cy);
-
- if(m_wndFleListSpliter.GetSafeHwnd())
- {
- m_wndFleListSpliter.MoveWindow(0, 0, cx, cy);
- /*
- m_wndFleListSpliter.MoveWindow(0, 0, cx, cy);
- m_wndFleListSpliter.SetRowInfo(0, cy/2, 30);
- m_wndFleListSpliter.SetRowInfo(1, 0, 30);
- m_wndFleListSpliter.RecalcLayout();
- */
- }
- }