FileTransView.cpp
上传用户:maryhy001
上传日期:2007-05-02
资源大小:2317k
文件大小:2k
源码类别:

网格计算

开发平台:

Visual C++

  1. // FileTransView.cpp : implementation file
  2. #include "stdafx.h"
  3. #include "trfAgent.h"
  4. #include "FileTransView.h"
  5. // CFileTransView
  6. IMPLEMENT_DYNCREATE(CFileTransView, CView)
  7. CFileTransView::CFileTransView(){}
  8. CFileTransView::~CFileTransView(){}
  9. BEGIN_MESSAGE_MAP(CFileTransView, CView)
  10. //{{AFX_MSG_MAP(CFileTransView)
  11. ON_WM_CREATE()
  12. ON_WM_SIZE()
  13. //}}AFX_MSG_MAP
  14. END_MESSAGE_MAP()
  15. void CFileTransView::OnDraw(CDC* pDC)
  16. {
  17. CDocument* pDoc = GetDocument();
  18. // TODO: add draw code here
  19. }
  20. // CFileTransView diagnostics
  21. #ifdef _DEBUG
  22. void CFileTransView::AssertValid() const
  23. {
  24. CView::AssertValid();
  25. }
  26. void CFileTransView::Dump(CDumpContext& dc) const
  27. {
  28. CView::Dump(dc);
  29. }
  30. #endif //_DEBUG
  31. /////////////////////////////////////////////////////////////////////////////
  32. int CFileTransView::OnCreate(LPCREATESTRUCT lpCreateStruct) 
  33. {
  34. if (CView::OnCreate(lpCreateStruct) == -1)
  35. return -1;
  36. if(!m_wndFleListSpliter.CreateStatic(this, 2, 1))
  37. {
  38. TRACE0("Failed to create send-recv list splitter windown");
  39. return -1;
  40. }
  41. CCreateContext *pContext = (CCreateContext*) lpCreateStruct->lpCreateParams;
  42. if(!m_wndFleListSpliter.CreateView(0, 0, RUNTIME_CLASS(CFileListSend), CSize(0, 200), pContext))
  43. {
  44. TRACE0("Failed to create send list view windown");
  45. return -1;
  46. }
  47. if(!m_wndFleListSpliter.CreateView(1, 0, RUNTIME_CLASS(CFileListRecv), CSize(0, 0), pContext))
  48. {
  49. TRACE0("Failed to create recv list view windown");
  50. return -1;
  51. }
  52. m_pwndFileSendList = (CFileListSend*)m_wndFleListSpliter.GetPane(0, 0); //send list window.
  53. m_pwndFileRecvList = (CFileListRecv*)m_wndFleListSpliter.GetPane(1, 0); //recv list window.
  54. m_wndFleListSpliter.SetActivePane(0, 0);
  55. return 0;
  56. }
  57. void CFileTransView::OnSize(UINT nType, int cx, int cy) 
  58. {
  59. CView::OnSize(nType, cx, cy);
  60. if(m_wndFleListSpliter.GetSafeHwnd())
  61. {
  62. m_wndFleListSpliter.MoveWindow(0, 0, cx, cy);
  63. /*
  64. m_wndFleListSpliter.MoveWindow(0, 0, cx, cy);
  65. m_wndFleListSpliter.SetRowInfo(0, cy/2, 30);
  66. m_wndFleListSpliter.SetRowInfo(1, 0, 30);
  67. m_wndFleListSpliter.RecalcLayout();
  68. */
  69. }
  70. }