中间件标准版5.1git,去除基础模块

ViewLog.cpp 1.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. // ViewListLog.cpp : CViewListLog 类的实现
  2. //
  3. #include "StdAfx.h"
  4. #include "ViewLog.h"
  5. #include "DisplayWnd.h"
  6. #include "resource.h"
  7. // CViewListLog
  8. IMPLEMENT_DYNAMIC(CViewLog, CListCtrl)
  9. CViewLog::CViewLog(void)
  10. {
  11. }
  12. CViewLog::~CViewLog(void)
  13. {
  14. }
  15. BEGIN_MESSAGE_MAP(CViewLog, CListCtrl)
  16. END_MESSAGE_MAP()
  17. /*****************************************************************
  18. **【函数名称】 create
  19. **【函数功能】 控件初始化
  20. **【参数】
  21. **【返回值】
  22. ****************************************************************/
  23. bool CViewLog::create(CDisplayWnd* pWnd)
  24. {
  25. ASSERT(pWnd != NULL);
  26. CString Name;
  27. Name.LoadString(IDS_STR_VIEW_LOG);
  28. // 创建pane
  29. if (!m_Pane.Create(Name, pWnd, CRect(0, 0, 900, 600), TRUE, IDS_STR_VIEW_LOG,
  30. WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS | WS_CLIPCHILDREN | CBRS_TOP | CBRS_FLOAT_MULTI))
  31. {
  32. TRACE0("创建日志窗口失败");
  33. return false;
  34. }
  35. m_Pane.EnableDocking(CBRS_ALIGN_ANY);
  36. //创建控件
  37. if(!Create(WS_CHILD | WS_VISIBLE | WS_VSCROLL | LVS_REPORT,
  38. CRect(0, 0, 0, 0), &m_Pane, IDC_LIST_LOG))
  39. {
  40. TRACE0("创建日志列表控件失败\n");
  41. return false;
  42. }
  43. pWnd->OnNewPane(&m_Pane);
  44. return true;
  45. }
  46. /*****************************************************************
  47. **【函数名称】 newSize
  48. **【函数功能】 调整控件大小
  49. **【参数】
  50. **【返回值】
  51. ****************************************************************/
  52. void CViewLog::newSize( CRect& Rect )
  53. {
  54. if(IsWindow(GetSafeHwnd()))
  55. SetWindowPos(NULL, Rect.left, Rect.top, Rect.Width(), Rect.Height(), SWP_NOACTIVATE | SWP_NOZORDER);
  56. }