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

#include "StdHeaders.h"

#include "EditRealCtrl.h"

#include "Dialog.h"

using namespace VectorWorks::VWUI;

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

VWEditRealCtrl::~VWEditRealCtrl()
{
}

bool VWEditRealCtrl::CreateControl(VWDialog* pDlg, double dDefaultValue, short widthInCharacters, EEditControlType type)
{
	::GS_CreateEditReal( gCBP, pDlg->GetControlID(), fControlID, (long) type, dDefaultValue, widthInCharacters );
	return VWControl::CreateControl( pDlg );
}

double VWEditRealCtrl::GetEditReal(EEditControlType type) const
{
	double value = 0.0;

	this->GetEditReal(type, value);

	return value;
}

bool VWEditRealCtrl::GetEditReal(EEditControlType type, double& outValue) const
{
	return ::GS_GetEditReal( gCBP, fpParentDlg->GetControlID(), fControlID, type, outValue );
}

void VWEditRealCtrl::SetEditReal(double value, EEditControlType type)
{
	::GS_SetEditReal( gCBP, fpParentDlg->GetControlID(), fControlID, type, value );
}

void VWEditRealCtrl::SelectContent()
{
	::GS_SelectEditText( gCBP, fpParentDlg->GetControlID(), fControlID );
}