本文整理汇总了C++中CItemInfo::SetImage方法的典型用法代码示例。如果您正苦于以下问题:C++ CItemInfo::SetImage方法的具体用法?C++ CItemInfo::SetImage怎么用?C++ CItemInfo::SetImage使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CItemInfo
的用法示例。
在下文中一共展示了CItemInfo::SetImage方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Add_MS_DOS_Stub
// -----------------------------------------------------------//
// Function : Add_MS_DOS_Stub
// Param : CHAR* pBuffer
// CMySuperGrid& m_ListGrid
// CTreeItem_* parentItem
// Return : CTreeItem_*
// Comment :
// -----------------------------------------------------------//
CTreeItem_* CPEShowView::Add_MS_DOS_Stub(CHAR* pBuffer, DWORD dwAddressBase, CMySuperGrid& m_ListGrid,CTreeItem_* parentItem)
{
if(pBuffer == NULL || parentItem == NULL)
{
return NULL;
}
CItemInfo* dosStubItem = new CItemInfo();
dosStubItem->SetImage(0);
dosStubItem->SetItemText("MS_DOS_Stub");
CString str;
str.Format(_T("%08x"), dwAddressBase);
dosStubItem->AddSubItemText(str);
dosStubItem->AddSubItemText("-");
dosStubItem->AddSubItemText("-");
dosStubItem->AddSubItemText("-");
dosStubItem->AddSubItemText("MS_DOS_Stub");
CTreeItem_* pDosTreeItem = m_ListGrid.InsertItem(parentItem, dosStubItem);
if(pDosTreeItem == NULL)
{
return NULL;
}
return pDosTreeItem;
}
示例2: _DeleteAll
void CMySuperGrid::_DeleteAll()
{
DeleteAll();//call CSuperGridCtrl::DeleteAll();
//add some new data
CItemInfo* lp = new CItemInfo();
lp->SetImage(4);
//add item text
lp->SetItemText(_T("New data"));
//Create root item
CTreeItem * pRoot = InsertRootItem(lp);//previous we call CreateTreeCtrl(lp)
if( pRoot == NULL )
return;
//insert items
int nCol = GetNumCol();
for(int i=0; i < nCol; i++)
{
CItemInfo* lpItemInfo = new CItemInfo();
CString strItem;
strItem.Format(_T("Item %d"),i);
//add items text
lpItemInfo->SetItemText(strItem);
//add subitem text
for(int y=0;y < nCol-1; y++)
{
CString str;
str.Format(_T("subItem %d of %s"),y,lpItemInfo->GetItemText());
lpItemInfo->AddSubItemText(str);
lpItemInfo->AddSubItemText(str);
}
//insert the iteminfo with ParentPtr
CTreeItem* pParent = InsertItem(pRoot, lpItemInfo);
//other nodes
if(i%nCol)
{
CTreeItem* pParent1=NULL;
CTreeItem* pParent2=NULL;
for(int x=0; x < nCol; x++)
{
CItemInfo* lpItemInfo = new CItemInfo();
CString strItem;
strItem.Format(_T("Item %d"),x);
lpItemInfo->SetItemText(strItem);
for(int z=0; z < nCol-1; z++)
{
CString str;
str.Format(_T("subItem %d of %s"),z, lpItemInfo->GetItemText());
lpItemInfo->AddSubItemText(str);
}
pParent1 = InsertItem(pParent, lpItemInfo);
}
}
}
//expand one level
Expand(pRoot, 0 /*listview index 0*/);
UINT uflag = LVIS_SELECTED | LVIS_FOCUSED;
SetItemState(0, uflag, uflag);
}