📄 dbstatistics.cpp
字号:
// DbStatistics.cpp : implementation file
//
#include "stdafx.h"
#include "..\nms.h"
#include "DbStatistics.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
extern CBrush *g_pWhiteBrush; /* 背景颜色 */
/////////////////////////////////////////////////////////////////////////////
// CDbStatistics dialog
CDbStatistics::CDbStatistics(CWnd* pParent /*=NULL*/)
: CDialog(CDbStatistics::IDD, pParent)
{
//{{AFX_DATA_INIT(CDbStatistics)
// NOTE: the ClassWizard will add member initialization here
//}}AFX_DATA_INIT
}
void CDbStatistics::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CDbStatistics)
// NOTE: the ClassWizard will add DDX and DDV calls here
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CDbStatistics, CDialog)
//{{AFX_MSG_MAP(CDbStatistics)
ON_WM_CTLCOLOR()
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CDbStatistics message handlers
void CDbStatistics::OnDbStaRefresh()
{
CString str;
CComboBox *pComBox = NULL;
CSubnet *pTemp=pApp->pSubnetFirst;
int nIndex=0;
pComBox = (CComboBox*)GetDlgItem(IDC_STAT_UPDATE_SUBNET);
if(pComBox)
{
pComBox->ResetContent();
for(; pTemp; pTemp=pTemp->next)
{
if(pTemp->status)
{
str.Format("%s %d" , "子网" , pTemp->subnet_id);
pComBox->InsertString(nIndex++ , str);
}
}
}
str.Format("%d" , nIndex);
GetDlgItem(IDC_STAT_UPDATE_SUBNET_NUM)->SetWindowText(str);
if(nIndex > 0)
{
str.Format("%s" , ctime(&pApp->pMainDlg->m_LastConfigTime));
}
else
{
str.Format("%d" , 0);
}
GetDlgItem(IDC_STAT_NMS_CONFIG_TIME)->SetWindowText(str);
UpdateData();
}
void CDbStatistics::OnDbStaReset()
{
CSubnet *pTemp=pApp->pSubnetFirst;
for(; pTemp; pTemp=pTemp->next)
{
pTemp->status = 0;
}
OnDbStaRefresh();
}
HBRUSH CDbStatistics::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
{
HBRUSH hbr = CDialog::OnCtlColor(pDC, pWnd, nCtlColor);
pDC->SetBkMode(TRANSPARENT);
return (HBRUSH)g_pWhiteBrush->m_hObject;
// TODO: Return a different brush if the default is not desired
//return hbr;
}
BOOL CDbStatistics::OnInitDialog()
{
CDialog::OnInitDialog();
OnDbStaRefresh();
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -