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

#include "StdHeaders.h"

#include "ColorButtonCtrl.h"

#include "Dialog.h"

using namespace VectorWorks::VWUI;

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

VWColorButtonCtrl::~VWColorButtonCtrl()
{
}

bool VWColorButtonCtrl::CreateControl(VWDialog* pDlg)
{
	::GS_CreateControl( gCBP, pDlg->GetControlID(), fControlID, kColorButtonControl, (unsigned char*)"", 0 );
	return VWControl::CreateControl( pDlg );
}

RGBColor VWColorButtonCtrl::GetColor() const
{
	RGBColor	color;
	color.red = color.green = color.blue = 0;

	::GS_GetColorButton( gCBP, fpParentDlg->GetControlID(), fControlID, color );
	return color;
}

void VWColorButtonCtrl::SetColor(const RGBColor& color)
{
	::GS_SetColorButton( gCBP, fpParentDlg->GetControlID(), fControlID, color );
}
