#include "ButtonControl.h"
#include "EEngineFrameWork.h"


CButtonControl::CButtonControl( int aIdx, LPCWSTR aName, int aX, int aY, int aWidth, int aHeight, DWORD aStyle )
{
	EEngineFrameWork* FrameWork = EEngineFrameWork::GetSingletonPtr();

	m_hWnd		= CreateWindow( L"button", aName, aStyle, aX, aY, aWidth, aHeight, FrameWork->m_hWnd, (HMENU)aIdx, FrameWork->m_hInst, NULL );
	m_nIdx		= aIdx;
	m_strText	= aName;
	m_nPosX		= aX;
	m_nPosY		= aY;
	m_nWidth	= aWidth;
	m_nHeight	= aHeight;
}


CButtonControl::~CButtonControl(void)
{
	DestroyWindow(m_hWnd);
}

void CButtonControl::SetText( LPCWSTR aText )
{
	SetWindowText( m_hWnd,  aText );
	m_strText = aText;
}

LPCWSTR CButtonControl::GetText( void )
{
	WCHAR Text[256] = {0,};
	GetWindowText( m_hWnd, Text, 256 );

	m_strText = Text;

	return m_strText.c_str();
}