本文整理汇总了C++中CItemInfo::GetCheck方法的典型用法代码示例。如果您正苦于以下问题:C++ CItemInfo::GetCheck方法的具体用法?C++ CItemInfo::GetCheck怎么用?C++ CItemInfo::GetCheck使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CItemInfo
的用法示例。
在下文中一共展示了CItemInfo::GetCheck方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: HowToLoopThroughAllItems_that_has_a_checkmark_and_print_them_or_what_ever
void CMySuperGrid::HowToLoopThroughAllItems_that_has_a_checkmark_and_print_them_or_what_ever(CDC *pDC)
{
TEXTMETRIC tm;
pDC->GetTextMetrics(&tm);
int cy = tm.tmHeight + tm.tmExternalLeading;
int nLineY=0;
nLineY+=cy;
pDC->TextOut(10,nLineY,_T("GIVE ME A BREAK YOU KNOW PRINT PREVIEW IS NOT THE ISSUE HERE"));
nLineY+=cy;
nLineY+=cy;
if(!GetItemCount())
return;
int nIndex=0;//has to be the root
if(nIndex!=-1)
{
//do a GetHeadPosition
POSITION pos = GetRootHeadPosition();
while(pos != NULL)
{
CTreeItem *pParent = (CTreeItem*)GetNextRoot(pos);
CTreeItem *pItem = pParent;
CItemInfo* lp = GetData(pParent);
if(lp->GetCheck())//very hard :)=
{
CString strData=lp->GetItemText();
strData+='\t';
nLineY+=cy;
for(int nCol=0; nCol < lp->GetItemCount(); nCol++)
{
CString str = lp->GetSubItem(nCol);
strData+=str;
strData+='\t';
}
pDC->TabbedTextOut(10,nLineY,strData,strData.GetLength(), 0, NULL, 0);
nLineY+=cy;
}
//GetNext ....loop through all children
for(;;)
{
CTreeItem *pCur = GetNext(pParent, pItem, TRUE, FALSE/*regardless of the item are hidden or not*/);
if(!IsChildOf(pParent, pCur))
break;
else
if(pCur==pItem)
break;
CItemInfo* lp = GetData(pCur);
if(lp->GetCheck())
{
CString strData = lp->GetItemText();
strData+='\t';
for(int nCol=0; nCol < lp->GetItemCount(); nCol++)
{
CString str = lp->GetSubItem(nCol);
strData+=str;
strData+='\t';
}
pDC->TabbedTextOut(10,nLineY,strData,strData.GetLength(), 0, NULL, 0);
nLineY+=cy;
}
pItem=pCur;
}
}//while
}//if
}