本文整理汇总了C++中CImageList::SetOverlayImage方法的典型用法代码示例。如果您正苦于以下问题:C++ CImageList::SetOverlayImage方法的具体用法?C++ CImageList::SetOverlayImage怎么用?C++ CImageList::SetOverlayImage使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CImageList
的用法示例。
在下文中一共展示了CImageList::SetOverlayImage方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Initalize
void CSharedDirsTreeCtrl::Initalize(CSharedFilesCtrl* pSharedFilesCtrl){
m_pSharedFilesCtrl = pSharedFilesCtrl;
SendMessage(CCM_SETUNICODEFORMAT, TRUE);
//WORD wWinVer = thePrefs.GetWindowsVersion();
m_bUseIcons = true;/*(wWinVer == _WINVER_2K_ || wWinVer == _WINVER_XP_ || wWinVer == _WINVER_ME_);*/
CImageList iml;
iml.Create(16, 16, theApp.m_iDfltImageListColorFlags | ILC_MASK, 0, 1);
iml.Add(CTempIconLoader(_T("ALLFILES"))); // All Directory
iml.Add(CTempIconLoader(_T("INCOMPLETE"))); // Temp Directory
iml.Add(CTempIconLoader(_T("OPENFOLDER"))); // Incoming Directory
iml.Add(CTempIconLoader(_T("CATEGORY"))); // Cats
iml.Add(CTempIconLoader(_T("HARDDISK"))); // All Dirs
CString strTempDir = thePrefs.GetIncomingDir();
if (strTempDir.Right(1) != "\\"){
strTempDir += "\\";
}
int nImage = theApp.GetFileTypeSystemImageIdx(strTempDir); // System Folder Icon
if (theApp.GetSystemImageList() != NULL){
iml.Add(::ImageList_GetIcon(theApp.GetSystemImageList(), nImage, 0));
}
else{
iml.Add(CTempIconLoader(_T("OPENFOLDER")));
}
iml.SetOverlayImage(iml.Add(CTempIconLoader(_T("ClientSecureOvl"))), 1);
SetImageList(&iml,TVSIL_NORMAL);
iml.Detach();
COLORREF crBk = GetSysColor(COLOR_WINDOW);
COLORREF crFg = GetSysColor(COLOR_WINDOWTEXT);
theApp.LoadSkinColorAlt(_T("SharedDirsTvBk"), _T("DefLvBk"), crBk);
theApp.LoadSkinColorAlt(_T("SharedDirsTvFg"), _T("DefLvFg"), crFg);
SetBkColor(crBk);
SetTextColor(crFg);
InitalizeStandardItems();
FilterTreeReloadTree();
CreateMenues();
}
示例2: SetAllIcons
void CSharedDirsTreeCtrl::SetAllIcons()
{
CImageList iml;
iml.Create(16, 16, theApp.m_iDfltImageListColorFlags | ILC_MASK, 0, 1);
iml.Add(CTempIconLoader(_T("ALLFILES"))); // All Directory
iml.Add(CTempIconLoader(_T("INCOMPLETE"))); // Temp Directory
iml.Add(CTempIconLoader(_T("OPENFOLDER"))); // Incoming Directory
iml.Add(CTempIconLoader(_T("CATEGORY"))); // Cats
iml.Add(CTempIconLoader(_T("HARDDISK"))); // All Dirs
CString strTempDir = thePrefs.GetMuleDirectory(EMULE_INCOMINGDIR);
if (strTempDir.Right(1) != "\\"){
strTempDir += "\\";
}
//MODIFIED by fengwen on 2007/01/17 <begin> : 提升启动速度
//int nImage = theApp.GetFileTypeSystemImageIdx(strTempDir); // System Folder Icon
//if (theApp.GetSystemImageList() != NULL){
// iml.Add(::ImageList_GetIcon(theApp.GetSystemImageList(), nImage, 0));
//}
//else{
// iml.Add(CTempIconLoader(_T("OPENFOLDER")));
//}
iml.Add(CTempIconLoader(_T("OPENFOLDER")));
//MODIFIED by fengwen on 2007/01/17 <end> : 提升启动速度
iml.SetOverlayImage(iml.Add(CTempIconLoader(_T("ClientSecureOvl"))), 1);
SetImageList(&iml, TVSIL_NORMAL);
m_imlTree.DeleteImageList();
m_imlTree.Attach(iml.Detach());
COLORREF crBk = GetSysColor(COLOR_WINDOW);
COLORREF crFg = GetSysColor(COLOR_WINDOWTEXT);
theApp.LoadSkinColorAlt(_T("SharedDirsTvBk"), _T("DefLvBk"), crBk);
theApp.LoadSkinColorAlt(_T("SharedDirsTvFg"), _T("DefLvFg"), crFg);
SetBkColor(crBk);
SetTextColor(crFg);
}
示例3: ShowIconSet
void CSetOverlayIcons::ShowIconSet(bool bSmallIcons)
{
m_cIconList.SetRedraw(FALSE);
m_cIconList.DeleteAllItems();
m_ImageList.DeleteImageList();
m_ImageListBig.DeleteImageList();
m_ImageList.Create(16, 16, ILC_COLOR32 | ILC_MASK, 20, 10);
m_ImageListBig.Create(32, 32, ILC_COLOR32 | ILC_MASK, 20, 10);
m_cIconList.SetImageList(&m_ImageList, LVSIL_SMALL);
m_cIconList.SetImageList(&m_ImageListBig, LVSIL_NORMAL);
// find all the icons of the selected icon set
CString sIconSet;
int index = m_cIconSet.GetCurSel();
if (index == CB_ERR)
{
// nothing selected. Shouldn't happen!
return;
}
m_cIconSet.GetLBText(index, sIconSet);
CString sIconSetPath = m_sIconPath + _T("\\") + sIconSet;
CImageList * pImageList = bSmallIcons ? &m_ImageList : &m_ImageListBig;
int pixelsize = (bSmallIcons ? 16 : 32);
HICON hNormalOverlay = (HICON)LoadImage(NULL, sIconSetPath+_T("\\NormalIcon.ico"), IMAGE_ICON, pixelsize, pixelsize, LR_LOADFROMFILE);
index = pImageList->Add(hNormalOverlay);
VERIFY(pImageList->SetOverlayImage(index, 1));
HICON hModifiedOverlay = (HICON)LoadImage(NULL, sIconSetPath+_T("\\ModifiedIcon.ico"), IMAGE_ICON, pixelsize, pixelsize, LR_LOADFROMFILE);
index = pImageList->Add(hModifiedOverlay);
VERIFY(pImageList->SetOverlayImage(index, 2));
HICON hConflictedOverlay = (HICON)LoadImage(NULL, sIconSetPath+_T("\\ConflictIcon.ico"), IMAGE_ICON, pixelsize, pixelsize, LR_LOADFROMFILE);
index = pImageList->Add(hConflictedOverlay);
VERIFY(pImageList->SetOverlayImage(index, 3));
HICON hReadOnlyOverlay = (HICON)LoadImage(NULL, sIconSetPath+_T("\\ReadOnlyIcon.ico"), IMAGE_ICON, pixelsize, pixelsize, LR_LOADFROMFILE);
index = pImageList->Add(hReadOnlyOverlay);
VERIFY(pImageList->SetOverlayImage(index, 4));
HICON hDeletedOverlay = (HICON)LoadImage(NULL, sIconSetPath+_T("\\DeletedIcon.ico"), IMAGE_ICON, pixelsize, pixelsize, LR_LOADFROMFILE);
index = pImageList->Add(hDeletedOverlay);
VERIFY(pImageList->SetOverlayImage(index, 5));
HICON hLockedOverlay = (HICON)LoadImage(NULL, sIconSetPath+_T("\\LockedIcon.ico"), IMAGE_ICON, pixelsize, pixelsize, LR_LOADFROMFILE);
index = pImageList->Add(hLockedOverlay);
VERIFY(pImageList->SetOverlayImage(index, 6));
HICON hAddedOverlay = (HICON)LoadImage(NULL, sIconSetPath+_T("\\AddedIcon.ico"), IMAGE_ICON, pixelsize, pixelsize, LR_LOADFROMFILE);
index = pImageList->Add(hAddedOverlay);
VERIFY(pImageList->SetOverlayImage(index, 7));
HICON hIgnoredOverlay = (HICON)LoadImage(NULL, sIconSetPath+_T("\\IgnoredIcon.ico"), IMAGE_ICON, pixelsize, pixelsize, LR_LOADFROMFILE);
index = pImageList->Add(hIgnoredOverlay);
VERIFY(pImageList->SetOverlayImage(index, 8));
HICON hUnversionedOverlay = (HICON)LoadImage(NULL, sIconSetPath+_T("\\UnversionedIcon.ico"), IMAGE_ICON, pixelsize, pixelsize, LR_LOADFROMFILE);
index = pImageList->Add(hUnversionedOverlay);
VERIFY(pImageList->SetOverlayImage(index, 9));
DestroyIcon(hNormalOverlay);
DestroyIcon(hModifiedOverlay);
DestroyIcon(hConflictedOverlay);
DestroyIcon(hReadOnlyOverlay);
DestroyIcon(hDeletedOverlay);
DestroyIcon(hLockedOverlay);
DestroyIcon(hAddedOverlay);
DestroyIcon(hIgnoredOverlay);
DestroyIcon(hUnversionedOverlay);
// create an image list with different file icons
SHFILEINFO sfi;
SecureZeroMemory(&sfi, sizeof sfi);
UINT flags = SHGFI_ICON | SHGFI_USEFILEATTRIBUTES;
if (bSmallIcons)
flags |= SHGFI_SMALLICON;
else
flags |= SHGFI_LARGEICON;
SHGetFileInfo(
_T("Doesn't matter"),
FILE_ATTRIBUTE_DIRECTORY,
&sfi, sizeof sfi,
flags);
int folderindex = pImageList->Add(sfi.hIcon); //folder
DestroyIcon(sfi.hIcon);
//folders
index = m_cIconList.InsertItem(m_cIconList.GetItemCount(), m_sNormal, folderindex);
VERIFY(m_cIconList.SetItemState(index, INDEXTOOVERLAYMASK(1), TVIS_OVERLAYMASK));
index = m_cIconList.InsertItem(m_cIconList.GetItemCount(), m_sModified, folderindex);
m_cIconList.SetItemState(index, INDEXTOOVERLAYMASK(2), TVIS_OVERLAYMASK);
index = m_cIconList.InsertItem(m_cIconList.GetItemCount(), m_sConflicted, folderindex);
m_cIconList.SetItemState(index, INDEXTOOVERLAYMASK(3), TVIS_OVERLAYMASK);
index = m_cIconList.InsertItem(m_cIconList.GetItemCount(), m_sReadOnly, folderindex);
m_cIconList.SetItemState(index, INDEXTOOVERLAYMASK(4), TVIS_OVERLAYMASK);
index = m_cIconList.InsertItem(m_cIconList.GetItemCount(), m_sDeleted, folderindex);
m_cIconList.SetItemState(index, INDEXTOOVERLAYMASK(5), TVIS_OVERLAYMASK);
index = m_cIconList.InsertItem(m_cIconList.GetItemCount(), m_sLocked, folderindex);
m_cIconList.SetItemState(index, INDEXTOOVERLAYMASK(6), TVIS_OVERLAYMASK);
index = m_cIconList.InsertItem(m_cIconList.GetItemCount(), m_sAdded, folderindex);
m_cIconList.SetItemState(index, INDEXTOOVERLAYMASK(7), TVIS_OVERLAYMASK);
index = m_cIconList.InsertItem(m_cIconList.GetItemCount(), m_sIgnored, folderindex);
m_cIconList.SetItemState(index, INDEXTOOVERLAYMASK(8), TVIS_OVERLAYMASK);
index = m_cIconList.InsertItem(m_cIconList.GetItemCount(), m_sUnversioned, folderindex);
m_cIconList.SetItemState(index, INDEXTOOVERLAYMASK(9), TVIS_OVERLAYMASK);
AddFileTypeGroup(_T(".cpp"), bSmallIcons);
//.........这里部分代码省略.........