userlistview.cpp
上传用户:swkcbjrc
上传日期:2016-04-02
资源大小:45277k
文件大小:3k
源码类别:

游戏

开发平台:

Visual C++

  1. // userlistview.cpp : implementation file
  2. //
  3. #include "stdafx.h"
  4. #include "..gamehigh.h"
  5. #include "..includeuserlistview.h"
  6. #ifdef _DEBUG
  7. #define new DEBUG_NEW
  8. #undef THIS_FILE
  9. static char THIS_FILE[] = __FILE__;
  10. #endif
  11. /////////////////////////////////////////////////////////////////////////////
  12. // CUserListView
  13. extern CGameHighApp theApp;
  14. extern CFaceList* gpFaceList;
  15. IMPLEMENT_DYNCREATE(CUserListView, CListView)
  16. CUserListView::CUserListView()
  17. {
  18. pUserInfoList =NULL;
  19. pFaceImgList =NULL;
  20. }
  21. CUserListView::~CUserListView()
  22. {
  23. SAFE_CHECKPOINTER(pUserInfoList)
  24. {
  25. delete pUserInfoList;
  26. pUserInfoList =NULL;
  27. }
  28. }
  29. BEGIN_MESSAGE_MAP(CUserListView, CView)
  30. //{{AFX_MSG_MAP(CUserListView)
  31. // NOTE - the ClassWizard will add and remove mapping macros here.
  32. //}}AFX_MSG_MAP
  33. END_MESSAGE_MAP()
  34. /////////////////////////////////////////////////////////////////////////////
  35. // CUserListView drawing
  36. void CUserListView::OnDraw(CDC* pDC)
  37. {
  38. CDocument* pDoc = GetDocument();
  39. // TODO: add draw code here
  40. }
  41. /////////////////////////////////////////////////////////////////////////////
  42. // CUserListView diagnostics
  43. #ifdef _DEBUG
  44. void CUserListView::AssertValid() const
  45. {
  46. CView::AssertValid();
  47. }
  48. void CUserListView::Dump(CDumpContext& dc) const
  49. {
  50. CView::Dump(dc);
  51. }
  52. #endif //_DEBUG
  53. /////////////////////////////////////////////////////////////////////////////
  54. // CUserListView message handlers
  55. void CUserListView::OnInitialUpdate() 
  56. {
  57. CListView::OnInitialUpdate();
  58. // TODO: Add your specialized code here and/or call the base class
  59. //GetListCtrl().InsertColumn(
  60. CListCtrl& theCtrl = GetListCtrl();
  61. theCtrl.InsertColumn(0,"战斗时间",LVCFMT_CENTER,60);
  62. theCtrl.InsertColumn(0,"战斗次数",LVCFMT_CENTER,60);
  63. theCtrl.InsertColumn(0,"职位",LVCFMT_CENTER,40);
  64. theCtrl.InsertColumn(0,"门派",LVCFMT_CENTER,40);
  65. theCtrl.InsertColumn(0,"和",LVCFMT_CENTER,30);
  66. theCtrl.InsertColumn(0,"输",LVCFMT_CENTER,30);
  67. theCtrl.InsertColumn(0,"赢",LVCFMT_CENTER,30);
  68. theCtrl.InsertColumn(0,"积分",LVCFMT_CENTER,40);
  69. theCtrl.InsertColumn(0,"级别",LVCFMT_CENTER,40);
  70. theCtrl.InsertColumn(0,"财富",LVCFMT_CENTER,40);
  71. theCtrl.InsertColumn(0,"网速",LVCFMT_CENTER,40);
  72. theCtrl.InsertColumn(0,"中文名",LVCFMT_CENTER,50);
  73. theCtrl.InsertColumn(0,"用户名",LVCFMT_CENTER,50);
  74. theCtrl.InsertColumn(0,"    ",LVCFMT_CENTER,30);
  75. DWORD dwStype=GetWindowLong(theCtrl.GetSafeHwnd(),GWL_STYLE);
  76. dwStype&=~LVS_TYPEMASK; //Remove the current stype flags
  77. dwStype|=LVS_REPORT; //Add the List stype
  78. SetWindowLong(theCtrl.GetSafeHwnd(),GWL_STYLE,dwStype); //Set it back into the list view
  79. SAFE_CHECKPOINTER(gpFaceList)
  80. {
  81. if(NULL == pFaceImgList)
  82. {
  83. pFaceImgList =gpFaceList->GetImageList4();
  84. }
  85. }
  86. SAFE_CHECKPOINTER(pFaceImgList)
  87. {
  88. theCtrl.SetImageList(pFaceImgList,LVSIL_SMALL);
  89. int nCount =pFaceImgList->GetImageCount();
  90. }
  91. SetRedraw(true);
  92. }