You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

62 lines
1.4 KiB
C++

#include "stdafx.h"
#include "LaiPuLaser.h"
#include "afxdialogex.h"
#include "DlgThreadState.h"
#include "AllThreadMgr.h"
#define UPDATE_INFO_TIMER 1
#define UPDATE_INFO_TIMER_DELAY 1000
IMPLEMENT_DYNAMIC(CDlgThreadState, CDialogEx)
BEGIN_MESSAGE_MAP(CDlgThreadState, CDialogEx)
ON_WM_TIMER()
END_MESSAGE_MAP()
CDlgThreadState::CDlgThreadState(CWnd* pParent /*=NULL*/)
: CDialogEx(CDlgThreadState::IDD, pParent)
{
m_bUpdateList = true;
}
CDlgThreadState::~CDlgThreadState()
{
}
void CDlgThreadState::DoDataExchange(CDataExchange* pDX)
{
CDialogEx::DoDataExchange(pDX);
DDX_Control(pDX, IDC_THREAD_LIST, m_List);
}
void CDlgThreadState::OnTimer(UINT nIDEvent)
{
if(nIDEvent == UPDATE_INFO_TIMER)
{
KillTimer(UPDATE_INFO_TIMER);
UpdateInfoExt();
if(m_bUpdateList)
{
SetTimer(UPDATE_INFO_TIMER,UPDATE_INFO_TIMER_DELAY,NULL);
}
}
CDialog::OnTimer(nIDEvent);
}
BOOL CDlgThreadState::OnInitDialog()
{
CDialogEx::OnInitDialog();
gAllThreadMgr.SetbDlgOpened(true);
gAllThreadMgr.InitStateList(m_List);
gAllThreadMgr.UpdateStateList(m_List,true);
UpdateData(FALSE);
SetTimer(UPDATE_INFO_TIMER,UPDATE_INFO_TIMER_DELAY,NULL);
return TRUE;
}
void CDlgThreadState::UpdateInfoExt()
{
if(m_bUpdateList)
gAllThreadMgr.UpdateStateList(m_List,false);
}