📄 statpage.cpp
字号:
// StatPage.cpp : implementation file
//
#include "stdafx.h"
#include "SIMTOOL.h"
#include "StatPage.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CStatPage dialog
CStatPage::CStatPage(CWnd* pParent /*=NULL*/)
: CDialogResize(CStatPage::IDD, pParent)
{
//{{AFX_DATA_INIT(CStatPage)
// NOTE: the ClassWizard will add member initialization here
//}}AFX_DATA_INIT
}
void CStatPage::DoDataExchange(CDataExchange* pDX)
{
CDialogResize::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CStatPage)
DDX_Control(pDX, IDC_STATLIST, m_StatList);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CStatPage, CDialogResize)
//{{AFX_MSG_MAP(CStatPage)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
BEGIN_DLGRESIZE_MAP(CStatPage)
DLGRESIZE_CONTROL(IDC_STATLIST, DLSZ_SIZE_X | DLSZ_SIZE_Y)
END_DLGRESIZE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CStatPage message handlers
BOOL CStatPage::OnInitDialog()
{
CDialogResize::OnInitDialog();
// TODO: Add extra initialization here
InitResizing(FALSE, FALSE, WS_CLIPCHILDREN);
m_StatList.InsertColumn(0, "统计");
m_StatList.InsertColumn(1, "值");
m_StatList.InsertItem(0, "连接时间");
m_StatList.SetItemText(0, 1, "0");
m_StatList.InsertItem(1, "连接速度(字节)");
m_StatList.SetItemText(1, 1, "0");
m_StatList.InsertItem(2, "接收数据量(KB)");
m_StatList.SetItemText(2, 1, "0");
m_StatList.InsertItem(3, "发送数据量(KB)");
m_StatList.SetItemText(3, 1, "0");
DWORD dwStyle = m_StatList.GetExtendedStyle();
dwStyle |= LVS_EX_FULLROWSELECT;
m_StatList.SetExtendedStyle(dwStyle);
AutoSizeColumns(&m_StatList);
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
void CStatPage::SetInfo(CString sTime,
CString sSpeed,
CString sSend,
CString sRecv)
{
m_StatList.SetItemText(0, 1, sTime);
m_StatList.SetItemText(1, 1, sSpeed);
m_StatList.SetItemText(2, 1, sRecv);
m_StatList.SetItemText(3, 1, sSend);
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -