#include "xmlradiobutton.h"

// ----------------------------------------------------------------------------
CXmlRadioButton::CXmlRadioButton(CXmlUi* pXmlUi, CXmlLayout* pParent)
	: CXmlCheckButton(pXmlUi, pParent)
{
	m_type				= eXmlUiType_RadioButton;

	m_groupId			= 0;
}

// ----------------------------------------------------------------------------
CXmlRadioButton::~CXmlRadioButton()
{
}

// ----------------------------------------------------------------------------
void CXmlRadioButton::LoadNodeAttribute(const DOMNamedNodeMap* nodeMap)
{
	CXmlCheckButton::LoadNodeAttribute(nodeMap);

	const XMLCh* nodeValue;
	if ( (nodeValue = GetNodeAttribute(nodeMap, "groupId")) != NULL )
	{
		char* tmpStr = XMLString::transcode(nodeValue);
		m_groupId = atoi(tmpStr);
		XMLString::release(&tmpStr);
	}
}

// ----------------------------------------------------------------------------
void CXmlRadioButton::Inherit(CXmlLayout* pXmlLayout)
{
	CXmlCheckButton::Inherit(pXmlLayout);
	CXmlRadioButton* pXmlRadioButton = dynamic_cast<CXmlRadioButton*>(pXmlLayout);
	if (pXmlRadioButton)
	{
		m_groupId = pXmlRadioButton->m_groupId;
	}
	
}