@17140@
@13830@
@13245@
@13635@
@13440@
@13245@

Modified by Robert H”hne to be used for RHIDE.

@13245@
@13245@
@14024@

@14828@
@14852@
@14567@
@14141@
@16849@
@16751@
@16727@
@16745@

TRangeValidator::TRangeValidator() : TFilterValidator("0123456789-+")
@23372@
  Min = INT_MIN;
  Max = INT_MAX;
@24151@

TRangeValidator::TRangeValidator(int aMin,int aMax) :
  TFilterValidator("0123456789+-")
@23372@
  Min = aMin;
  Max = aMax;
  if (Min > Max)
@12966@
    Min = aMax;
    Max = aMin;
@12978@
  if (Min >= 0) strcpy(ValidChars,"0123456789+");
  if (Max < 0) strcpy(ValidChars,"0123456789-");
@24151@

void TRangeValidator::Error()
@23372@
  messageBox(mfError | mfOKButton,_("Value not in the range %d to %d"),Min,Max);
@24151@

Boolean TRangeValidator::IsValid(const char *S)
@23372@
  int value;
  if (TFilterValidator::IsValid(S) == False) return False;
  sscanf(S,"%d",&value);
  if (value < Min || value > Max) return False;
@12886@
@24151@

ushort TRangeValidator::Transfer(char *S,void * Buffer,
  TVTransfer Flag)
@23372@
  if (!(Options & voTransfer)) return 0;
  switch (Flag)
@12966@
@07490@
      sscanf(S,"%d",(int *)Buffer);
      break;
@07491@
      sprintf(S,"%d",*((int *)Buffer));
      break;
    default:
      break;
@12978@
  return sizeof(int);
@24151@

#if !defined( NO_STREAM )
TRangeValidator::TRangeValidator(StreamableInit) :
  TFilterValidator(streamableInit)
@23372@
@24151@

TStreamable * TRangeValidator::build()
@23372@
  return (TStreamable *) new TRangeValidator(streamableInit);
@24151@

void TRangeValidator::write(opstream & os)
@23372@
  TFilterValidator::write(os);
  os << Min << Max;
@24151@

void * TRangeValidator::read(ipstream & is)
@23372@
  TFilterValidator::read(is);
  is >> Min >> Max;
@12904@
@24151@
#endif // NO_STREAM

