Пример #1
0
//
// reads an instance of TGroupBox from the passed ipstream
//
void*
TGroupBox::Streamer::Read(ipstream& is, uint32 /*version*/) const
{
  ReadBaseObject((TControl*)GetObject(), is);
  is >> GetObject()->NotifyParent;
  return GetObject();
}
Пример #2
0
//
/// reads an instance of TCheckBox from the passed ipstream
//
void*
TCheckBox::Streamer::Read(ipstream& is, uint32 /*version*/) const
{
  ReadBaseObject((TButton*)GetObject(), is);
  is >> GetObject()->Group;
  return GetObject();
}
Пример #3
0
void*
TButton::Streamer::Read(ipstream& is, uint32 /*version*/) const
{
  ReadBaseObject((TControl*)GetObject(), is);
  is >> GetObject()->IsDefPB;
  return GetObject();
}
Пример #4
0
void *TCadLine::Streamer::Read(ipstream& in, uint32 /*ver*/) const
{

  ReadBaseObject((TCadObjectBase*) this, in);
  in >> GetObject()->p1 >> GetObject()->p2;
  return GetObject();
}
Пример #5
0
//
/// Reads an instance of TStatic from the passed ipstream
//
void*
TStatic::Streamer::Read(ipstream& is, uint32 /*version*/) const
{
  ReadBaseObject((TControl*)GetObject(), is);
  is >> GetObject()->TextLimit;
  return GetObject();
}
Пример #6
0
//
// reads an instance of TEditSearch from the passed ipstream.
// Re-opens the modeless find or replace dialog if one was up.
//
void*
TEditSearch::Streamer::Read(ipstream& is, uint32 /*version*/) const
{
  ReadBaseObject((TEdit*)GetObject(), is);

  GetObject()->SearchData.Read(is);
  is >> GetObject()->SearchCmd;
  GetObject()->SearchDialog = 0;
  return GetObject();
}
Пример #7
0
void*
TSlider::Streamer::Read(ipstream& is, uint32 version) const
{
  TSlider* o = GetObject();
  ReadBaseObject((TScrollBar*)o, is);
  is >> o->Min
     >> o->Max
     >> o->Pos
     >> o->ThumbResId
     >> o->ThumbRect;
  if (version == 1) {
    TRect tmpRect;
    is >> tmpRect;     // dummy CaretRect for compatibilty with stream v1
  }
Пример #8
0
void *TCadMultiLine::Streamer::Read(ipstream& in, uint32 /*ver*/) const
{
  ReadBaseObject((TCadObjectBase*) this, in);
  TPoints::size_type count;
  count=in.readWord32();
  TPoints* pts=&(GetObject()->points);
  pts->erase(pts->begin(), pts->end());
  TPoint p;
  while (count--) {
    in >> p;
    pts->push_back(p);
  }

  return GetObject();
}
Пример #9
0
//
/// Reads an instance of TMDIClient from the passed ipstream
//
void*
TMDIClient::Streamer::Read(ipstream& is, uint32 /*version*/) const
{
  ReadBaseObject((TWindow*)GetObject(), is);

  if (GetObject()->ClientAttr == 0)
    GetObject()->ClientAttr = new CLIENTCREATESTRUCT;  //

  uint idFirstChild;  // Need temp for near data model since ClientAttr is 
  is >> idFirstChild;
  GetObject()->ClientAttr->idFirstChild = idFirstChild;
  GetObject()->ClientAttr->hWindowMenu = (HMENU) 0;
  GetObject()->Attr.Param = reinterpret_cast<LPVOID>(GetObject()->ClientAttr);

  return GetObject();
}
Пример #10
0
void*
TUrlLink::Streamer::Read(ipstream& is, uint32 /*version*/) const
{
  ReadBaseObject((TStatic*)GetObject(), is);

  GetObject()->LinkFont = 0;

  is >> GetObject()->LinkColor;
  is >> GetObject()->VisitedColor;
  is >> GetObject()->HoverColor;
  is >> GetObject()->bUnderline;
  is >> GetObject()->bVisited;
  is >> GetObject()->bOverControl;

  GetObject()->SetupCursor();

  return GetObject();
}
Пример #11
0
void *TCadGroup::Streamer::Read(ipstream& in, uint32 /*ver*/) const
{
  ReadBaseObject((TCadObjectBase*) this, in);

  TCadObjectBasePtrVector::size_type count;
  count=in.readWord32();
  TCadObjectBasePtrVector* objs=&(GetObject()->objects);
  objs->erase(objs->begin(), objs->end());

  TCadObjectBasePtr p;
  while (count--) {
    p=new TCadObjectBase;
    in >> *p;
    objs->push_back(p);
  }

  return GetObject();
}
Пример #12
0
//
// reads an instance of TEditFile from the passed ipstream
//
void*
TEditFile::Streamer::Read(ipstream& is, uint32 /*version*/) const
{
  TEditFile* o = GetObject();
  ReadBaseObject((TEditSearch*)o, is);

#if defined(UNICODE)
  _USES_CONVERSION;
  char * fileName = is.freadString();

  o->FileName = _A2W(fileName);

  delete[] fileName;
#else
  o->FileName = is.freadString();
#endif
  if (!*o->FileName) {
    delete o->FileName;
    o->FileName = 0;
  }
  return o;
}
Пример #13
0
//
/// Checks the validity of the input according to the format specified by the
/// picture string, possibly adding fill characters to the end of the input.
//
/// Formats the string passed in input according to the format specified by the
/// picture string pointed to by Pic. Picture returns prError if there is an error
/// in the picture string or if input contains data that cannot fit the specified
/// picture. Returns prComplete if input can fully satisfy the specified picture.
/// Returns prIncomplete if input contains data that incompletely fits the specified
/// picture.
/// The following characters are used in creating format pictures:
/// 
/// Special	
/// - \b #	Accept only a digit
/// - \b ?	Accept only a letter (case_insensitive)
/// - \b &	Accept only a letter, force to uppercase
/// - \b @	Accept any character
/// - \b !	Accept any character, force to uppercase
/// Match
/// - \b ;	Take next character literally
/// - \b *	Repetition count
/// - \b []	Option
/// - \b {}	Grouping operators
/// - \b ,	Set of alternatives
/// - All others	Taken literally
//
TPicResult
TPXPictureValidator::Picture(LPTSTR input, bool autoFill)
{
  if (!SyntaxCheck())
    return prSyntax;
  if (!input || !*input)
    return prEmpty;

  uint j = 0;  // index for input[]
  uint i = 0;  // index for Pic[]

  TPicResult rslt = Process(input, Pic.length(), i, j);
  if (rslt != prError && rslt != prSyntax && j < ::_tcslen(input))
    rslt = prError;

  // If the result is incomplete & autofill is requested, then copy literal
  // characters from the picture over to the input.
  //
  if (rslt == prIncomplete && autoFill) {
    bool  reprocess = false;
#if defined(BI_PDOXWINJ_SUPPORT)
    // "����"
    while (i < Pic.length() && !lstrchrp("#?&!@*{}[],\x81\x93\x81\x97", (LPCSTR)Pic.c_str()+i)) {
#else
    while (i < Pic.length() && !_tcschr(_T("#?&!@*{}[],"), Pic[i])) {
#endif
      if (Pic[i] == _T(';'))
        i++;
#if defined(BI_DBCS_SUPPORT)
      uint k = ::_tcslen(input);
      uint n = CharSize((LPCTSTR)Pic.c_str() + i) / sizeof(tchar);
      memmove(input + k, Pic.c_str() + i, n);
      input[k + n] = _T('\0');
      i += n;
      j += n;
#else
      input[j++] = Pic[i++];
#endif
      reprocess = true;
    }
    if (reprocess) {
      input[j] = 0;   // terminate the copy, since we are probably appending
      j = i = 0;
      rslt = Process(input, Pic.length(), i, j);
    }
  }

  return (rslt == prAmbiguous) ? prComplete
                               : (rslt == prIncompNoFill) ? prIncomplete : rslt;
}


IMPLEMENT_STREAMABLE1(TPXPictureValidator, TValidator);

#if !defined(BI_NO_OBJ_STREAMING)

//
//
//
void*
TPXPictureValidator::Streamer::Read(ipstream& is, uint32 /*version*/) const
{
  ReadBaseObject((TValidator*)GetObject(), is);
  is >> GetObject()->Pic;
  return GetObject();
}
Пример #14
0
void *TCadLabel::Streamer::Read(ipstream& in, uint32 /*ver*/) const
{
  ReadBaseObject((TCadObjectBase*) this, in);

  return GetObject();
}
Пример #15
0
void*
TVSlider::Streamer::Read(ipstream& is, uint32 /*version*/) const
{
  ReadBaseObject((TSlider*)GetObject(), is);
  return GetObject();
}