Beispiel #1
0
CString CExtensionListControl::CListItem::GetText(int subitem) const
{
    switch (subitem)
    {
    case COL_EXTENSION:
        {
            return GetExtension();
        }

    case COL_COLOR:
        {
            return _T("(color)");
        }

    case COL_BYTES:
        {
            return FormatBytes(m_record.bytes);
        }

    case COL_FILES:
        {
            return FormatCount(m_record.files);
        }

    case COL_DESCRIPTION:
        {
            return GetDescription();
        }

    case COL_BYTESPERCENT:
        {
            return GetBytesPercent();
        }

    default:
        {
            ASSERT(0);
            return wds::strEmpty;
        }
    }
}
Beispiel #2
0
CString CItem::GetText(int subitem) const
{
	CString s;
	switch (subitem)
	{
	case COL_NAME:
		s = m_name;
		break;

	case COL_SUBTREEPERCENTAGE:
		if (IsDone())
		{
			ASSERT(m_readJobs == 0);
			//s = "ok";
		}
		else
		{
			if (m_readJobs == 1)
				s.LoadString(IDS_ONEREADJOB);
			else
				s.FormatMessage(IDS_sREADJOBS, FormatCount(m_readJobs));
		}
		break;

	case COL_PERCENTAGE:
		if (GetOptions()->IsShowTimeSpent() && MustShowReadJobs() || IsRootItem())
		{
			s.Format(_T("[%s s]"), FormatMilliseconds(GetTicksWorked()));
		}
		else
		{
			s.Format(_T("%s%%"), FormatDouble(GetFraction() * 100));
		}
		break;

	case COL_SUBTREETOTAL:
		s = FormatBytes(GetSize());
		break;

	case COL_ITEMS:
		if (GetType() != IT_FILE && GetType() != IT_FREESPACE && GetType() != IT_UNKNOWN)
			s = FormatCount(GetItemsCount());
		break;

	case COL_FILES:
		if (GetType() != IT_FILE && GetType() != IT_FREESPACE && GetType() != IT_UNKNOWN)
			s = FormatCount(GetFilesCount());
		break;

	case COL_SUBDIRS:
		if (GetType() != IT_FILE && GetType() != IT_FREESPACE && GetType() != IT_UNKNOWN)
			s = FormatCount(GetSubdirsCount());
		break;

	case COL_LASTCHANGE:
		if (GetType() != IT_FREESPACE && GetType() != IT_UNKNOWN)
		{
			s = FormatFileTime(m_lastChange);
		}
		break;

	case COL_ATTRIBUTES:
		if (GetType() != IT_FREESPACE && GetType() != IT_UNKNOWN && GetType() != IT_MYCOMPUTER && GetType() != IT_FILESFOLDER)
		{
			s = FormatAttributes(GetAttributes());
		}
		break;

	default:
		ASSERT(0);
		break;
	}
	return s;
}
Beispiel #3
0
const char        *P3DImageFmtHandlerWx::FormatExt
                                      (unsigned int        FormatIndex) const
 {
  return P3DImageFmtWxExts[FormatIndex < FormatCount() ? FormatIndex : 0];
 }