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

#include "StdHeaders.h"

#include "CheckButtonCtrl.h"

#include "Dialog.h"

using namespace VectorWorks::VWUI;

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

VWCheckButtonCtrl::~VWCheckButtonCtrl()
{
}

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

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

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

	return (bool)state;
}

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