// OutputButton.cpp
//

#include "stdafx.h"
#include "WEB_IO_TEST.h"
#include "OutputButton.h"
#include "WEB_IO_TESTDlg.h"


// COutputButton

IMPLEMENT_DYNAMIC(COutputButton, CButton)
COutputButton::COutputButton()
{
	m_iNumber = 1;
}

COutputButton::~COutputButton()
{
}


BEGIN_MESSAGE_MAP(COutputButton, CButton)
	ON_CONTROL_REFLECT(BN_CLICKED, OnBnClicked)
	ON_WM_TIMER()
END_MESSAGE_MAP()



// Processing the COutputButton message.


void COutputButton::OnBnClicked()
{
	CWEB_IO_TESTDlg *pPDlg = (CWEB_IO_TESTDlg *)GetParent();

	this->PostMessage(WM_KEYDOWN, VK_TAB);
	if(m_eStatus != EOF_OFF)
		pPDlg->m_rhSndSetOnOff(m_iNumber, EOF_OFF);
	else
		pPDlg->m_rhSndSetOnOff(m_iNumber, EOF_ON);

	pPDlg->EnableOutputAll(FALSE);
}

void COutputButton::SetNumber(int iNum)
{
	m_iNumber = iNum;
}

void COutputButton::OnTimer(UINT nIDEvent)
{
	CButton::OnTimer(nIDEvent);
}
