Exemplo n.º 1
0
const TCHAR *
DataFieldFileReader::GetItem(unsigned index) const
{
  EnsureLoadedDeconst();

  return files[index].path;
}
Exemplo n.º 2
0
const TCHAR *
DataFieldFileReader::getItem(unsigned index) const
{
  EnsureLoadedDeconst();

  return files[index].mTextPathFile;
}
Exemplo n.º 3
0
unsigned
DataFieldFileReader::size() const
{
  EnsureLoadedDeconst();

  return files.size();
}
Exemplo n.º 4
0
int
DataFieldFileReader::GetNumFiles(void) const
{
  EnsureLoadedDeconst();

  return files.size();
}
Exemplo n.º 5
0
unsigned
FileDataField::GetNumFiles() const
{
  EnsureLoadedDeconst();

  return files.size();
}
Exemplo n.º 6
0
int
DataFieldFileReader::GetAsInteger() const
{
  if (!postponed_value.empty())
    EnsureLoadedDeconst();

  return mValue;
}
Exemplo n.º 7
0
int
FileDataField::GetAsInteger() const
{
  if (!postponed_value.empty())
    EnsureLoadedDeconst();

  return current_index;
}
Exemplo n.º 8
0
ComboList *
DataFieldFileReader::CreateComboList() const
{
  /* sorry for the const_cast .. this method keeps the promise of not
     modifying the object, given that one does not count filling the
     (cached) file list as "modification" */
  EnsureLoadedDeconst();

  ComboList *cl = new ComboList();

  TCHAR buffer[MAX_PATH];

  for (unsigned i = 0; i < files.size(); i++) {
    const TCHAR *path = files[i].mTextFile;
    if (path == NULL)
      path = _T("");

    /* is a file with the same base name present in another data
       directory? */

    bool found = false;
    for (unsigned j = 1; j < files.size(); j++) {
      if (j != i && _tcscmp(path, files[j].mTextFile) == 0) {
        found = true;
        break;
      }
    }

    if (found) {
      /* yes - append the absolute path to allow the user to see the
         difference */
      _tcscpy(buffer, path);
      _tcscat(buffer, _T(" ("));
      _tcscat(buffer, files[i].mTextPathFile);
      _tcscat(buffer, _T(")"));
      path = buffer;
    }

    cl->Append(i, path);
    if (i == mValue) {
      cl->ComboPopupItemSavedIndex = i;
    }
  }

  return cl;
}
Exemplo n.º 9
0
ComboList
FileDataField::CreateComboList(const TCHAR *reference) const
{
  /* sorry for the const_cast .. this method keeps the promise of not
     modifying the object, given that one does not count filling the
     (cached) file list as "modification" */
  EnsureLoadedDeconst();

  ComboList combo_list;

  TCHAR buffer[MAX_PATH];

  for (unsigned i = 0; i < files.size(); i++) {
    const TCHAR *path = files[i].filename;
    assert(path != nullptr);

    /* is a file with the same base name present in another data
       directory? */

    bool found = false;
    for (unsigned j = 1; j < files.size(); j++) {
      if (j != i && StringIsEqual(path, files[j].filename)) {
        found = true;
        break;
      }
    }

    if (found) {
      /* yes - append the absolute path to allow the user to see the
         difference */
      _tcscpy(buffer, path);
      _tcscat(buffer, _T(" ("));
      _tcscat(buffer, files[i].path);
      _tcscat(buffer, _T(")"));
      path = buffer;
    }

    combo_list.Append(i, path);
  }

  combo_list.current_index = current_index;

  return combo_list;
}