www.pudn.com > DalsaNetlink.rar > CyDiagnosticInfoDlg.cpp


// CyDiagnosticInfoDlg.cpp : implementation file 
// 
 
#include "stdafx.h" 
#include "CyApp.h" 
#include "CyDiagnosticInfoDlg.h" 
 
#ifdef _DEBUG 
#define new DEBUG_NEW 
#undef THIS_FILE 
static char THIS_FILE[] = __FILE__; 
#endif 
 
///////////////////////////////////////////////////////////////////////////// 
// CyDiagnosticInfoDlg dialog 
 
 
CyDiagnosticInfoDlg::CyDiagnosticInfoDlg(CWnd* pParent /*=NULL*/) 
	: CDialog(CyDiagnosticInfoDlg::IDD, pParent) 
{ 
	//{{AFX_DATA_INIT(CyDiagnosticInfoDlg) 
		// NOTE: the ClassWizard will add member initialization here 
	//}}AFX_DATA_INIT 
} 
 
 
void CyDiagnosticInfoDlg::DoDataExchange(CDataExchange* pDX) 
{ 
	CDialog::DoDataExchange(pDX); 
	//{{AFX_DATA_MAP(CyDiagnosticInfoDlg) 
	DDX_Control(pDX, IDC_ERROR_LIST, mList); 
	//}}AFX_DATA_MAP 
} 
 
 
BEGIN_MESSAGE_MAP(CyDiagnosticInfoDlg, CDialog) 
	//{{AFX_MSG_MAP(CyDiagnosticInfoDlg) 
	//}}AFX_MSG_MAP 
END_MESSAGE_MAP() 
 
///////////////////////////////////////////////////////////////////////////// 
// CyDiagnosticInfoDlg message handlers 
 
BOOL CyDiagnosticInfoDlg::OnInitDialog()  
{ 
	CDialog::OnInitDialog(); 
 
    DWORD lStyle = mList.GetExtendedStyle(); 
    lStyle |= LVS_EX_GRIDLINES; 
    lStyle |= LVS_EX_FULLROWSELECT; 
    mList.SetExtendedStyle( lStyle ); 
	 
    unsigned int i, j; 
	for ( i = 0; i < mData.size(); ++i ) 
    { 
        mList.InsertColumn( i, mData[ i ].mHeader.c_str(), LVCFMT_LEFT, mData[ i ].mWidth ); 
 
        for ( j = 0; j < mData[ i ].mItems.size(); ++j ) 
        { 
            if ( i == 0 ) 
                mList.InsertItem( j, mData[ i ].mItems[ j ].c_str() ); 
            else 
                mList.SetItemText( j, i, mData[ i ].mItems[ j ].c_str() ); 
        } 
    } 
	 
	return TRUE;  // return TRUE unless you set the focus to a control 
	              // EXCEPTION: OCX Property Pages should return FALSE 
}