Ejemplo n.º 1
0
int CExtensionListControl::CListItem::GetImage() const
{
    if(m_image == -1)
    {
        m_image = GetMyImageList()->getExtImageAndDescription(m_extension, m_description);
    }
    return m_image;
}
Ejemplo n.º 2
0
bool CExtensionListControl::CListItem::DrawSubitem(int subitem, CDC *pdc, CRect rc, UINT state, int *width, int *focusLeft) const
{
    if(subitem == COL_EXTENSION)
    {
        DrawLabel(m_list, GetMyImageList(), pdc, rc, state, width, focusLeft);
    }
    else if(subitem == COL_COLOR)
    {
        DrawColor(pdc, rc, state, width);
    }
    else
    {
        return false;
    }

    return true;
}
Ejemplo n.º 3
0
// As we will not receive WM_CREATE, we must do initialization
// in this extra method. The counterpart is OnDestroy().
void CExtensionListControl::Initialize()
{
    SetSorting(COL_BYTES, false);

    InsertColumn(COL_EXTENSION,     LoadString(IDS_EXTCOL_EXTENSION),   LVCFMT_LEFT, 60, COL_EXTENSION);
    InsertColumn(COL_COLOR,         LoadString(IDS_EXTCOL_COLOR),       LVCFMT_LEFT, 40, COL_COLOR);
    InsertColumn(COL_BYTES,         LoadString(IDS_EXTCOL_BYTES),       LVCFMT_RIGHT, 60, COL_BYTES);
    InsertColumn(COL_BYTESPERCENT,  _T("% ") + LoadString(IDS_EXTCOL_BYTES), LVCFMT_RIGHT, 50, COL_BYTESPERCENT);
    InsertColumn(COL_FILES,         LoadString(IDS_EXTCOL_FILES),       LVCFMT_RIGHT, 50, COL_FILES);
    InsertColumn(COL_DESCRIPTION,   LoadString(IDS_EXTCOL_DESCRIPTION), LVCFMT_LEFT, 170, COL_DESCRIPTION);

    OnColumnsInserted();

    // We don't use the list control's image list, but attaching an image list
    // to the control ensures a proper line height.
    SetImageList(GetMyImageList(), LVSIL_SMALL);
}
Ejemplo n.º 4
0
int CItem::GetImageToCache() const
{ 
	// (Caching is done in CTreeListItem::m_vi.)

	int image;

	if (GetType() == IT_MYCOMPUTER)
	{
		image = GetMyImageList()->GetMyComputerImage();
	}
	else if (GetType() == IT_FILESFOLDER)
	{
		image = GetMyImageList()->GetFilesFolderImage();
	}
	else if (GetType() == IT_FREESPACE)
	{
		image = GetMyImageList()->GetFreeSpaceImage();
	}
	else if (GetType() == IT_UNKNOWN)
	{
		image = GetMyImageList()->GetUnknownImage();
	}
	else
	{
		CString path = GetPath();

		if (GetType() == IT_DIRECTORY && GetApp()->IsMountPoint(path))
		{
			image = GetMyImageList()->GetMountPointImage();
		}
		else
		if (GetType() == IT_DIRECTORY && GetApp()->IsJunctionPoint(path))
		{
			image = GetMyImageList()->GetJunctionImage();
		}
		else
		{
			image = GetMyImageList()->GetFileImage(path);
		}
	}
	return image; 
}
Ejemplo n.º 5
0
int CDriveItem::GetImage() const
{
	return GetMyImageList()->GetFileImage(m_path);
}