//
//	Copyright © 2006 Nemetschek North America 
//	All Rights Reserved.
//
// Created by Vladislav Stanev

#include "StdHeaders.h"

#include "RadioButtonCtrl.h"

#include "Dialog.h"

using namespace VectorWorks::VWUI;

VWRadioButtonCtrl::VWRadioButtonCtrl(TControlID id)
: VWControl( id )
{
}

VWRadioButtonCtrl::~VWRadioButtonCtrl()
{
}

bool VWRadioButtonCtrl::CreateControl(VWDialog* pDlg, const TXString& text)
{
	::GS_CreateRadioButton( gCBP, pDlg->GetControlID(), fControlID, text );
	return VWControl::CreateControl( pDlg );
}

bool VWRadioButtonCtrl::GetState() const
{
	Boolean			state	= 0;

	::GS_GetBooleanItem( gCBP, fpParentDlg->GetControlID(), fControlID, state );

	return (bool)state;
}

void VWRadioButtonCtrl::SetState(bool state)
{
	::GS_SetBooleanItem( gCBP, fpParentDlg->GetControlID(), fControlID, state );
}
