#include "xeditfielddefinition.h"

XEditFieldDefinition::XEditFieldDefinition()
    : XAsset()
    , mMinVal(0)
    , mMaxVal(0)
    , mDefVal(0)
    , mRange(0)
    , mMaxChars(0)
    , mMaxCharsGotoNext(0)
    , mMaxPaintChars(0)
    , mPaintOffset(0)
{
    SetName("Edit Field Definition");
}

XEditFieldDefinition::~XEditFieldDefinition()
{

}

void XEditFieldDefinition::ParseData(XDataStream *aStream)
{
    mMinVal = aStream->ParseSingle(QString("%1 min val").arg(GetName()));
    mMaxVal = aStream->ParseSingle(QString("%1 max val").arg(GetName()));
    mDefVal = aStream->ParseSingle(QString("%1 def val").arg(GetName()));
    mRange = aStream->ParseSingle(QString("%1 range").arg(GetName()));
    mMaxChars = aStream->ParseInt32(QString("%1 max chars").arg(GetName()));
    mMaxCharsGotoNext = aStream->ParseInt32(QString("%1 max chars goto next").arg(GetName()));
    mMaxPaintChars = aStream->ParseInt32(QString("%1 max paint chars").arg(GetName()));
    mPaintOffset = aStream->ParseInt32(QString("%1 paint offset").arg(GetName()));
}

void XEditFieldDefinition::Clear()
{
    mMinVal = 0;
    mMaxVal = 0;
    mDefVal = 0;
    mRange = 0;
    mMaxChars = 0;
    mMaxCharsGotoNext = 0;
    mMaxPaintChars = 0;
    mPaintOffset = 0;
}
