// SpectrInit1.cpp : implementation file
//

#include "stdafx.h"
#include "CheckTr.h"
#include "SpectrInit1.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CSpectrInit dialog


CSpectrInit::CSpectrInit(CWnd* pParent /*=NULL*/)
	: CDialog(CSpectrInit::IDD, pParent)
{
	//{{AFX_DATA_INIT(CSpectrInit)
		// NOTE: the ClassWizard will add member initialization here
	//}}AFX_DATA_INIT
}


void CSpectrInit::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CSpectrInit)
	DDX_Text(pDX, IDC_MESSAGE1, m_Message1);
	DDX_Control(pDX, IDC_LIST1, m_InList);
		// NOTE: the ClassWizard will add DDX and DDV calls here
	//}}AFX_DATA_MAP

	SpectrSelected=m_InList.GetCurSel();
	int i;
	for (i=0; i < m_NmbSpectr; i++)
	{
		//Display it.
		CString	strByteRead;
		//Convert the value to a 2-character Cstring.
		strByteRead.Format("%d", i+1 );
		strByteRead = strByteRead.Right(2); 
		//Display the value in the Bytes Received List Box.
		m_InList.InsertString(-1, strByteRead);		
		m_InList.SetCurSel(0);		
	}
}


BEGIN_MESSAGE_MAP(CSpectrInit, CDialog)
	//{{AFX_MSG_MAP(CSpectrInit)
		// NOTE: the ClassWizard will add message map macros here
	ON_LBN_SELCHANGE(IDC_LIST1, OnList1)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CSpectrInit message handlers

void CSpectrInit::OnList1() 
{
	SpectrSelected=m_InList.GetCurSel();
}
