#include "stdafx.h"
#include "UICheckBox.h"

namespace DuiLib
{
	LPCTSTR CCheckBoxUI::GetClass() const
	{
		return _T("CheckBoxUI");
	}

	LPVOID CCheckBoxUI::GetInterface(LPCTSTR pstrName)
	{
		if( _tcscmp(pstrName, DUI_CTR_CHECKBOX) == 0 ) return static_cast<CCheckBoxUI*>(this);
		return COptionUI::GetInterface(pstrName);
	}

	void CCheckBoxUI::SetCheck(bool bCheck, bool bTriggerEvent)
	{
		//if (GetCheck()==bCheck)
		//{
		//	return;
		//}

		Selected(bCheck, bTriggerEvent);
	}

	bool  CCheckBoxUI::GetCheck() const
	{
		return IsSelected();
	}
}
