userlistview.cpp
资源名称:1731.rar [点击查看]
上传用户:swkcbjrc
上传日期:2016-04-02
资源大小:45277k
文件大小:3k
源码类别:
游戏
开发平台:
Visual C++
- // userlistview.cpp : implementation file
- //
- #include "stdafx.h"
- #include "..gamehigh.h"
- #include "..includeuserlistview.h"
- #ifdef _DEBUG
- #define new DEBUG_NEW
- #undef THIS_FILE
- static char THIS_FILE[] = __FILE__;
- #endif
- /////////////////////////////////////////////////////////////////////////////
- // CUserListView
- extern CGameHighApp theApp;
- extern CFaceList* gpFaceList;
- IMPLEMENT_DYNCREATE(CUserListView, CListView)
- CUserListView::CUserListView()
- {
- pUserInfoList =NULL;
- pFaceImgList =NULL;
- }
- CUserListView::~CUserListView()
- {
- SAFE_CHECKPOINTER(pUserInfoList)
- {
- delete pUserInfoList;
- pUserInfoList =NULL;
- }
- }
- BEGIN_MESSAGE_MAP(CUserListView, CView)
- //{{AFX_MSG_MAP(CUserListView)
- // NOTE - the ClassWizard will add and remove mapping macros here.
- //}}AFX_MSG_MAP
- END_MESSAGE_MAP()
- /////////////////////////////////////////////////////////////////////////////
- // CUserListView drawing
- void CUserListView::OnDraw(CDC* pDC)
- {
- CDocument* pDoc = GetDocument();
- // TODO: add draw code here
- }
- /////////////////////////////////////////////////////////////////////////////
- // CUserListView diagnostics
- #ifdef _DEBUG
- void CUserListView::AssertValid() const
- {
- CView::AssertValid();
- }
- void CUserListView::Dump(CDumpContext& dc) const
- {
- CView::Dump(dc);
- }
- #endif //_DEBUG
- /////////////////////////////////////////////////////////////////////////////
- // CUserListView message handlers
- void CUserListView::OnInitialUpdate()
- {
- CListView::OnInitialUpdate();
- // TODO: Add your specialized code here and/or call the base class
- //GetListCtrl().InsertColumn(
- CListCtrl& theCtrl = GetListCtrl();
- theCtrl.InsertColumn(0,"战斗时间",LVCFMT_CENTER,60);
- theCtrl.InsertColumn(0,"战斗次数",LVCFMT_CENTER,60);
- theCtrl.InsertColumn(0,"职位",LVCFMT_CENTER,40);
- theCtrl.InsertColumn(0,"门派",LVCFMT_CENTER,40);
- theCtrl.InsertColumn(0,"和",LVCFMT_CENTER,30);
- theCtrl.InsertColumn(0,"输",LVCFMT_CENTER,30);
- theCtrl.InsertColumn(0,"赢",LVCFMT_CENTER,30);
- theCtrl.InsertColumn(0,"积分",LVCFMT_CENTER,40);
- theCtrl.InsertColumn(0,"级别",LVCFMT_CENTER,40);
- theCtrl.InsertColumn(0,"财富",LVCFMT_CENTER,40);
- theCtrl.InsertColumn(0,"网速",LVCFMT_CENTER,40);
- theCtrl.InsertColumn(0,"中文名",LVCFMT_CENTER,50);
- theCtrl.InsertColumn(0,"用户名",LVCFMT_CENTER,50);
- theCtrl.InsertColumn(0," ",LVCFMT_CENTER,30);
- DWORD dwStype=GetWindowLong(theCtrl.GetSafeHwnd(),GWL_STYLE);
- dwStype&=~LVS_TYPEMASK; //Remove the current stype flags
- dwStype|=LVS_REPORT; //Add the List stype
- SetWindowLong(theCtrl.GetSafeHwnd(),GWL_STYLE,dwStype); //Set it back into the list view
- SAFE_CHECKPOINTER(gpFaceList)
- {
- if(NULL == pFaceImgList)
- {
- pFaceImgList =gpFaceList->GetImageList4();
- }
- }
- SAFE_CHECKPOINTER(pFaceImgList)
- {
- theCtrl.SetImageList(pFaceImgList,LVSIL_SMALL);
- int nCount =pFaceImgList->GetImageCount();
- }
- SetRedraw(true);
- }