// MRIDlg.cpp : Implementation file
//

#include "stdafx.h"
#include "RemoteTest.h"
#include "MRIDlg.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CMRIDlg  dialog


CMRIDlg::CMRIDlg(CWnd* pParent /*=NULL*/)
	: CDialog(CMRIDlg::IDD, pParent)
{
	//{{AFX_DATA_INIT(CMRIDlg)
	//}}AFX_DATA_INIT
}


void CMRIDlg::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CMRIDlg)
	DDX_Control(pDX, IDC_EDIT_SEMDISP, m_semDispEdit);
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(CMRIDlg, CDialog)
	//{{AFX_MSG_MAP(CMRIDlg)
	ON_WM_DESTROY()
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CMRIDlg message handlers

void CMRIDlg::OnOK() 
{	
	CDialog::OnOK();
}

void CMRIDlg::DisplayOutput(CString &strMsg)
{
	CString		str;

	if ( m_semDispEdit.GetLineCount() > 500 ) {
		int	ix = m_semDispEdit.LineIndex(100);
		m_semDispEdit.SetSel(0,ix,TRUE);
		m_semDispEdit.ReplaceSel("");
	}

	str = strMsg;
	m_semDispEdit.SetSel( m_semDispEdit.GetWindowTextLength(),
							m_semDispEdit.GetWindowTextLength() );
	m_semDispEdit.ReplaceSel(str,FALSE);
	m_semDispEdit.UpdateWindow();
}

void CMRIDlg::OnDestroy() 
{
	CDialog::OnDestroy();
}

void CMRIDlg::DisplayBatteryLevel( UINT level )
{
	SetDlgItemInt( IDC_EDIT_BATTERY, level );
}
