AeStringFieldUI.c++ 1004 Bytes
#include <assert.h>
#include <string.h>

#include "AeTypes.h"
#include "AeFieldUI.h"
#include "AeAsset.h"
#include "AeAssetUI.h"


AeStringFieldUI::AeStringFieldUI (const char * name,
				  Boolean isEditable,
				  Boolean isSelectable,
				  Boolean isHierarchical,
				  Boolean isCommon,
				  TJustify justify,
				  TStringGetProc getProc,
				  TStringSetProc setProc) : 
    AeFieldUI (name, isEditable, isSelectable, isHierarchical, isCommon, justify, kStringMaxLen)
{
    fGetProc = getProc;
    fSetProc = setProc;
}

AeStringFieldUI::~AeStringFieldUI (void)
{
}

void
AeStringFieldUI::GetValueString (AeAsset * asset, String string)
{
    String value = fGetProc (asset);
    strcpy (string, value);
}

Boolean
AeStringFieldUI::SetValueString (AeAsset * asset, String string)
{
    assert (fSetProc);

    if (!strcmp (string, fGetProc (asset)))
	return False;

    fSetProc (asset, string);
    return True;
}

Boolean
AeStringFieldUI::VerifyValueString (String string)
{
    return True;
}