📄 playerlist.cpp
字号:
// PlayerList.cpp : implementation file
//
#include "stdafx.h"
#include "chinesechess.h"
#include "PlayerList.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CPlayerList dialog
CPlayerList::CPlayerList(CWnd* pParent /*=NULL*/)
: CDialog(CPlayerList::IDD, pParent)
{
//{{AFX_DATA_INIT(CPlayerList)
// NOTE: the ClassWizard will add member initialization here
//}}AFX_DATA_INIT
}
void CPlayerList::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CPlayerList)
DDX_Control(pDX, IDC_LIST_PLAYER, m_ListPlayer);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CPlayerList, CDialog)
//{{AFX_MSG_MAP(CPlayerList)
ON_NOTIFY(NM_DBLCLK, IDC_LIST_PLAYER, OnDblclkListPlayer)
ON_WM_TIMER()
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CPlayerList message handlers
BOOL CPlayerList::OnInitDialog()
{
CDialog::OnInitDialog();
LV_COLUMN lvcol;
lvcol.mask=LVCF_FMT|LVCF_TEXT|LVCF_WIDTH;
lvcol.fmt=LVCFMT_LEFT;
lvcol.cx=100;
lvcol.pszText="序 号";
lvcol.iSubItem=0;
m_ListPlayer.InsertColumn(0,&lvcol);
lvcol.pszText="姓 名";
lvcol.iSubItem=1;
m_ListPlayer.InsertColumn(1,&lvcol);
lvcol.pszText="地 址";
lvcol.iSubItem=2;
m_ListPlayer.InsertColumn(2,&lvcol);
lvcol.pszText="端口号";
lvcol.iSubItem=3;
m_ListPlayer.InsertColumn(3,&lvcol);
lvcol.pszText="上线时间";
lvcol.iSubItem=4;
m_ListPlayer.InsertColumn(4,&lvcol);
lvcol.pszText="是否为服务器";
lvcol.iSubItem=5;
m_ListPlayer.InsertColumn(5,&lvcol);
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
void CPlayerList::OnDblclkListPlayer(NMHDR* pNMHDR, LRESULT* pResult)
{
// TODO: Add your control notification handler code here
*pResult = 0;
}
void CPlayerList::OnTimer(UINT nIDEvent)
{
// TODO: Add your message handler code here and/or call default
CDialog::OnTimer(nIDEvent);
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -