// AlarmEventDlg.cpp : 实现文件
//

#include "stdafx.h"
#include "NetSDKDemo.h"
#include "AlarmEventDlg.h"


// CAlarmEventDlg 对话框

IMPLEMENT_DYNAMIC(CAlarmEventDlg, CDialog)

CAlarmEventDlg::CAlarmEventDlg(CRect rcClient, CWnd* pParent /*=NULL*/)
	: CDialog(CAlarmEventDlg::IDD, pParent)
{

}

CAlarmEventDlg::~CAlarmEventDlg()
{
}

void CAlarmEventDlg::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	DDX_Control(pDX, IDC_LIST_ALARMEVENT, m_ctlEventList);
}


BEGIN_MESSAGE_MAP(CAlarmEventDlg, CDialog)
	ON_WM_SIZE()
END_MESSAGE_MAP()


// CAlarmEventDlg 消息处理程序

BOOL CAlarmEventDlg::OnInitDialog()
{
	CDialog::OnInitDialog();

	// TODO:  在此添加额外的初始化
	CRect rcClient;
	GetClientRect(&rcClient);
	m_ctlEventList.MoveWindow(rcClient);
	
	m_ctlEventList.DeleteAllItems();
	m_ctlEventList.InsertColumn(0, "告警时间", LVCFMT_LEFT, rcClient.Width()/4);
	m_ctlEventList.InsertColumn(1, "告警信息", LVCFMT_LEFT,rcClient.Width()/2);
	m_ctlEventList.InsertColumn(2, "告警设备", LVCFMT_LEFT, rcClient.Width()/4);
	return TRUE;  // return TRUE unless you set the focus to a control
	// 异常: OCX 属性页应返回 FALSE
}

void CAlarmEventDlg::OnSize(UINT nType, int cx, int cy)
{
	CDialog::OnSize(nType, cx, cy);
	
	CRect rcClient;
	GetClientRect(&rcClient);
	m_ctlEventList.MoveWindow(rcClient);
	// TODO: 在此处添加消息处理程序代码
}
