spacetrader/Src/SetField.c
2017-08-05 16:30:32 +01:00

27 lines
703 B
C

// *************************************************************************
// SetField.c
//
// Modifications:
// mm/dd/yy - description - author
// *************************************************************************
#include "external.h"
Handle SetField( FormPtr frm, int Nr, char* Value, int Size, Boolean Focus )
{
Word objIndex;
CharPtr AmountP;
Handle AmountH;
objIndex = FrmGetObjectIndex( frm, Nr );
AmountH = MemHandleNew( Size );
AmountP = MemHandleLock( AmountH );
StrCopy( AmountP, Value );
MemPtrUnlock( AmountP );
FldSetTextHandle( FrmGetObjectPtr( frm, objIndex ), AmountH );
if (Focus)
FrmSetFocus( frm, objIndex );
return AmountH;
}