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

#include "StdHeaders.h"

#include "ColorPopupCtrl.h"

#include "Dialog.h"

using namespace VectorWorks::VWUI;

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

VWColorPopupCustomCtrl::~VWColorPopupCustomCtrl()
{
}

bool VWColorPopupCustomCtrl::CreateControl(VWDialog* pDlg)
{
	::GS_CreateColorPopup( gCBP, pDlg->GetControlID(), fControlID );
	return VWControl::CreateControl( pDlg );
}

ColorRef VWColorPopupCustomCtrl::GetSelectedColor() const
{
	short		colorIndex;
	
	::GS_GetColorChoice( gCBP, fpParentDlg->GetControlID(), fControlID, colorIndex );

	return colorIndex;
}

void VWColorPopupCustomCtrl::SetSelectedColor(const ColorRef &colorIndex)
{
	::GS_SetColorChoice( gCBP, fpParentDlg->GetControlID(), fControlID, colorIndex );
}
