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

#include "StdHeaders.h"

#include "EditIntegerCtrl.h"

#include "Dialog.h"

using namespace VectorWorks::VWUI;

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

VWEditIntegerCtrl::~VWEditIntegerCtrl()
{
}

bool VWEditIntegerCtrl::CreateControl(VWDialog* pDlg, long lDefaultValue, short widthInCharacters)
{
	::GS_CreateEditInteger( gCBP, pDlg->GetControlID(), fControlID, lDefaultValue, widthInCharacters );
	return VWControl::CreateControl( pDlg );
}


long VWEditIntegerCtrl::GetEditInteger() const
{
	long value = 0;
	this->GetEditInteger( value );

	return value;
}

bool VWEditIntegerCtrl::GetEditInteger(long& outValue) const
{
	return ::GS_GetEditInteger( gCBP, fpParentDlg->GetControlID(), fControlID, outValue );
}

void VWEditIntegerCtrl::SetEditInteger(long value)
{
	::GS_SetEditInteger( gCBP, fpParentDlg->GetControlID(), fControlID, value );
}

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