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

#include "StdHeaders.h"

#include "MarkerPopupCtrl.h"

#include "Dialog.h"

using namespace VectorWorks::VWUI;

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

VWMarkerPopupCtrl::~VWMarkerPopupCtrl()
{
}

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

void VWMarkerPopupCtrl::GetSelectedItem(SMarkerStyle& outValue) const
{
	::GS_GetMarkerChoice( gCBP, fpParentDlg->GetControlID(), fControlID,
									outValue.style,
									outValue.nAngle,
									outValue.dSize,
									outValue.dWidth,
									outValue.nThicknessBasis,
									outValue.dThickness );

}

void VWMarkerPopupCtrl::SetSelectedItem(const SMarkerStyle& value)
{
	::GS_SetMarkerChoice( gCBP, fpParentDlg->GetControlID(), fControlID,
									value.style,
									value.nAngle,
									value.dSize,
									value.dWidth,
									value.nThicknessBasis,
									value.dThickness );
}
