• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ ItemHasChildren函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中ItemHasChildren函数的典型用法代码示例。如果您正苦于以下问题:C++ ItemHasChildren函数的具体用法?C++ ItemHasChildren怎么用?C++ ItemHasChildren使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了ItemHasChildren函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: GetRootItem

CString CStatisticsTree::GetText(bool onlyVisible, HTREEITEM theItem, int theItemLevel, bool firstItem)
{
	bool bPrintHeader = firstItem;
	HTREEITEM hCurrent;
	if (theItem == NULL)
	{
		hCurrent = GetRootItem(); // Copy All Vis or Copy All
	}
	else
	{
		if (bPrintHeader && (!ItemHasChildren(theItem) || !IsExpanded(theItem)))
			bPrintHeader = false;
		hCurrent = theItem;
	}

	CString	strBuffer;
	if (bPrintHeader)
		strBuffer.Format(_T("eMule v%s %s [%s]\r\n\r\n"), theApp.m_strCurVersionLong, GetResString(IDS_SF_STATISTICS) ,thePrefs.GetUserNick());

	while (hCurrent != NULL)
	{
		for (int i = 0; i < theItemLevel; i++)
			strBuffer += _T("   ");
		strBuffer += GetItemText(hCurrent);
		if (bPrintHeader || !firstItem)
			strBuffer += _T("\r\n");
		if (ItemHasChildren(hCurrent) && (!onlyVisible || IsExpanded(hCurrent)))
			strBuffer += GetText(onlyVisible, GetChildItem(hCurrent), theItemLevel+1, false);
		hCurrent = GetNextItem(hCurrent, TVGN_NEXT);
		if (firstItem && theItem != NULL)
			break; // Copy Selected Branch was used, so we don't want to copy all branches at this level.  Only the one that was selected.
	}
	return strBuffer;
}
开发者ID:axxapp,项目名称:winxgui,代码行数:34,代码来源:StatisticsTree.cpp


示例2: GetNextChild

VectorTreeItemId BFBackupTree::GetTaskItems (wxTreeItemId idParent, bool bGoDeep /*= true*/)
{
    VectorTreeItemId vec;

    wxTreeItemId idCurr;
    wxTreeItemIdValue idCookie;

    if (ItemHasChildren(idParent))
    {
        for (idCurr = GetFirstChild(idParent, idCookie);
             idCurr.IsOk();
             idCurr = GetNextChild(idParent, idCookie))
        {
            if (ItemHasChildren(idCurr) == bGoDeep)
            {
                VectorTreeItemId vecSub(GetTaskItems(idCurr, true));

                for (ItVectorTreeItemId it = vecSub.begin();
                     it != vecSub.end();
                     it++)
                {
                    vec.push_back(*it);
                }
            }
            else
            {
                if (IsTask(idCurr))
                    vec.push_back(idCurr);
            }
        }
    }

    return vec;
}
开发者ID:BackupTheBerlios,项目名称:blackfisk-svn,代码行数:34,代码来源:BFBackupTree.cpp


示例3: switch

void ctlTree::NavigateTree(int keyCode)
{
	switch(keyCode)
	{
		case WXK_LEFT:
			{
				//If tree item has children and is expanded, collapse it, otherwise select it's parent if has one
				wxTreeItemId currItem = GetSelection();

				if (ItemHasChildren(currItem) && IsExpanded(currItem))
				{
					Collapse(currItem);
				}
				else
				{
					wxTreeItemId parent = GetItemParent(currItem);
					if (parent.IsOk())
					{
						SelectItem(currItem, false);
						SelectItem(parent, true);
					}
				}
			}
			break;
		case WXK_RIGHT:
			{
				//If tree item do not have any children ignore it,
				//otherwise  expand it if not expanded, and select first child if already expanded
				wxTreeItemId currItem = GetSelection();

				if(ItemHasChildren(currItem))
				{
					if (!IsExpanded(currItem))
					{
						Expand(currItem);
					}
					else
					{
						wxCookieType cookie;
						wxTreeItemId firstChild = GetFirstChild(currItem, cookie);
						SelectItem(currItem, false);
						SelectItem(firstChild, true);
					}
				}
			}
			break;
		default:
			wxASSERT_MSG(false, _("Currently handles only right and left arrow key, other keys are working"));
			break;
	}
}
开发者ID:AnnaSkawinska,项目名称:pgadmin3,代码行数:51,代码来源:ctlTree.cpp


示例4: locker

void svSymbolTree::BuildTree(const wxFileName& fn)
{
    TagEntryPtrVector_t newTags;
    ITagsStoragePtr db = TagsManagerST::Get()->GetDatabase();
    if ( !db ) {
        return;
    }
    
    db->SelectTagsByFile(fn.GetFullPath(), newTags);
    if ( TagsManagerST::Get()->AreTheSame(newTags, m_currentTags) )
        return;
    
    wxWindowUpdateLocker locker(this);
    SymbolTree::BuildTree(fn, &newTags);
    
    // Request from the parsing thread list of include files
    ++m_uid;
    
    ParseRequest *req = new ParseRequest(this);
    req->setFile(fn.GetFullPath());
    req->setType(ParseRequest::PR_PARSE_INCLUDE_STATEMENTS);
    req->_uid = m_uid; // Identifies this request
    ParseThreadST::Get()->Add( req );
    
    wxTreeItemId root = GetRootItem();
    if( root.IsOk() && ItemHasChildren(root) ) {
        wxTreeItemIdValue cookie;
        wxTreeItemId child = GetFirstChild(root, cookie);
        while ( child.IsOk() ) {
            Expand(child);
            child = GetNextChild(root, cookie);
        }
    }
}
开发者ID:05storm26,项目名称:codelite,代码行数:34,代码来源:outline_symbol_tree.cpp


示例5: return

HTREEITEM CMyTreeCtrl::FindItem( HTREEITEM hItem, DWORD dwData, bool f )
{
	if( hItem == (HTREEITEM)NULL )
		return (HTREEITEM)NULL;

	PSrvrData pSrvrData	= (PSrvrData)GetItemData( hItem );
	if( f == true ) {
		if( pSrvrData->dwId == dwData )
			return hItem;
	}
	else {
		if( pSrvrData->dpid == dwData )
			return hItem;
	}

	if( TRUE == ItemHasChildren( hItem ) )
	{
		HTREEITEM hFind		= FindItem( GetChildItem( hItem ), dwData, f );
		if( hFind != (HTREEITEM)NULL )
			return hFind;
		return FindItem( GetNextSiblingItem( hItem ), dwData, f );
	}
	else
	{
		return FindItem( GetNextSiblingItem( hItem ), dwData, f );
	}
}
开发者ID:iceberry,项目名称:flyffsf,代码行数:27,代码来源:MYTREECTRL.cpp


示例6: ASSERT

void CMyTreeCtrl::PostEnumItem( HTREEITEM hItem, bool f, PENUMITEM pEnumItem )
{
	if( hItem == (HTREEITEM)NULL )
		return;

	if( f == true )
		pEnumItem	= new ENUMITEM;

	PSrvrData pData		= (PSrvrData)GetItemData( hItem );
	ASSERT( pData );
	if( pData->dwId < MAX_ID )
		pEnumItem->m_ahEnumItem[pEnumItem->m_uSizeofEnumItem++]		= hItem;

	if( TRUE == ItemHasChildren( hItem ) )
	{
		if( f == false )
			PostEnumItem( GetNextSiblingItem( hItem ), false, pEnumItem );
		PostEnumItem( GetChildItem( hItem ), false, pEnumItem );
	}
	else
	{
		if( f == false )
			PostEnumItem( GetNextSiblingItem( hItem ), false, pEnumItem );
	}

	if( f == true )
	{
		m_lspEnumItem.push_back( pEnumItem );
	}
}
开发者ID:iceberry,项目名称:flyffsf,代码行数:30,代码来源:MYTREECTRL.cpp


示例7: GetTreeItem

wxTreeItemId wxSpinTreeCtrl::GetTreeItem(const char *nodeId, wxTreeItemId idParent, wxTreeItemIdValue cookie)
{
    if (! idParent.IsOk())
        return NULL;

    wxSpinTreeItemData *treeData = (wxSpinTreeItemData*)GetItemData(idParent);
    if (treeData && treeData->m_pNode.valid())
    {
        if (strcmp(treeData->m_pNode->id->s_name, nodeId) == 0)
        {
            return idParent;
        }
    }

    if (ItemHasChildren(idParent))
    {
        wxTreeItemId child;
        for (child = GetFirstChild(idParent, cookie); child.IsOk(); child = GetNextChild(idParent, cookie))
        {
            wxTreeItemId targetItem = GetTreeItem(nodeId, child, cookie);
            if (targetItem.IsOk())
                return targetItem;
        }
    }
    return GetTreeItem(nodeId, GetNextSibling(idParent), cookie);
}
开发者ID:mikewoz,项目名称:spinframework,代码行数:26,代码来源:wxSpinTreeCtrl.cpp


示例8: Expand

void wxGxTreeViewBase::OnObjectRefreshed(wxGxCatalogEvent& event)
{
	wxTreeItemId TreeItemId = m_TreeMap[event.GetObjectID()];
	if(TreeItemId.IsOk())
	{
		wxGxTreeItemData* pData = (wxGxTreeItemData*)GetItemData(TreeItemId);
		if(pData != NULL)
		{
			if(pData->m_bExpandedOnce)
			{
                //deleted via refresh
				//DeleteChildren(TreeItemId);
				pData->m_bExpandedOnce = false;
				Expand(TreeItemId);
			}
            else
            {
                wxGxObject* pGxObject = m_pCatalog->GetRegisterObject(event.GetObjectID());
			    wxGxObjectContainer* pGxObjectContainer = dynamic_cast<wxGxObjectContainer*>(pGxObject);
				wxBusyCursor wait;
			    if(pGxObjectContainer && pGxObjectContainer->HasChildren() && !ItemHasChildren(TreeItemId))
                {
                    SetItemHasChildren(TreeItemId);
                }
            }
		}
	}
}
开发者ID:Mileslee,项目名称:wxgis,代码行数:28,代码来源:gxtreeview.cpp


示例9: FindItemByPath

wxTreeItemId BFBackupTree::FindItemByPath (wxTreeItemId idStart, const wxString& strPath)
{
    wxTreeItemId            idCurr, idLast;
    wxTreeItemIdValue       idCookie;
    wxString                str;

    // check start item
    if (HasPath(idStart, strPath))
        return idStart;

    if (ItemHasChildren(idStart))
    {
        for (idCurr = GetFirstChild(idStart, idCookie);
             idCurr.IsOk();
             idCurr = GetNextChild(idStart, idCookie))
        {
            idLast = FindItemByPath(idCurr, strPath);

            if (idLast.IsOk())
                return idLast;
        }
    }

    return wxTreeItemId();
}
开发者ID:BackupTheBerlios,项目名称:blackfisk-svn,代码行数:25,代码来源:BFBackupTree.cpp


示例10: while

BOOL CDirTreeCtrl::AddSubDirAsItem1(HTREEITEM hParent)
{
	CString strPath,strFileName;
	HTREEITEM hChild;
	//---------------------去除该父项下所有的子项------------   // 因为有dummy项,并且有时子目录再次打开,或子目录会刷新等,因此必须去除。
	while ( ItemHasChildren(hParent))  {
		hChild = GetChildItem(hParent);
		DeleteItem( hChild );
	}    //-----------------------装入该父项下所有子项--------------  
	strPath = GetFullPath(hParent);

	CString strSearchCmd = strPath;
	if( strSearchCmd.Right( 1 ) != _T( "\\" ))
		strSearchCmd += _T( "\\" );

	strSearchCmd += _T( "*.*" );
	CFileFind find;
	BOOL bContinue = find.FindFile( strSearchCmd );
	while ( bContinue )  {
		bContinue = find.FindNextFile();
		strFileName = find.GetFileName();

		 if(!find.IsHidden() && ! find.IsDots() && find.IsDirectory() )
		 {
			 hChild = AddItem( hParent, strFileName );
		 }

		if ( !find.IsHidden() && ! find.IsDots() && !find.IsDirectory() )   {
			InsertItem( strFileName, 0, 0, hParent );
		}
    }

    return TRUE; 
}
开发者ID:neil-yi,项目名称:ffsource,代码行数:34,代码来源:DirTreeCtrl.cpp


示例11: GetItemText

//------------------------------------------------------------------------------
wxTreeItemId OutputTree::FindItem(wxTreeItemId parentId, const wxString &name)
{
   #if DEBUG_OUTPUT_TREE
   MessageInterface::ShowMessage
      ("OutputTree::FindItem() parentId=%s, name=%s\n",
       GetItemText(parentId).c_str(), name.c_str());
   #endif
   
   wxTreeItemId itemId;
   
   if (ItemHasChildren(parentId))
   {
      wxString itemText;
      wxTreeItemIdValue cookie;
      wxTreeItemId childId = GetFirstChild(parentId, cookie);
      
      while (childId.IsOk())
      {
         itemText = GetItemText(childId);
         if (itemText == name)
            return childId;
         
         childId = GetNextChild(parentId, cookie);
      }
   }
   
   return itemId;
}
开发者ID:rockstorm101,项目名称:GMAT,代码行数:29,代码来源:OutputTree.cpp


示例12: GetFirstChild

wxTreeItemId SessionTreeControl::findSession( wxTreeItemId root,
                                                std::string address )
{
    wxTreeItemIdValue temp; // unused var, needed in getchild
    wxTreeItemId targetItem;
    wxTreeItemId current = GetFirstChild( root, temp );

    while ( current.IsOk() )
    {
        wxString text = GetItemText( current );
        std::string target = std::string( text.char_str() );
        if ( target.compare( address ) == 0 )
            return current;

        if ( ItemHasChildren( current ) )
        {
            targetItem = findSession( current, address );
            if ( targetItem.IsOk() )
                return targetItem;
        }
        current = GetNextChild( root, temp );
    }

    wxTreeItemId none;
    return none; // return default value if not found
}
开发者ID:Adhesion,项目名称:grav,代码行数:26,代码来源:SessionTreeControl.cpp


示例13: GetRootItem

void KGTreeCtrl::SortTree(HTREEITEM hTreeItem)
{
	HTREEITEM hSubItem = NULL;
	if (!hTreeItem)
	{
		hTreeItem = GetRootItem();
//		hTreeItem = GetChildItem(TVI_ROOT);
		KG_PROCESS_ERROR(hTreeItem);
		SortChildren(NULL);
	}
	hSubItem = hTreeItem;
	SortChildren(hSubItem);
	HTREEITEM BrotherItem = hSubItem;
	if (ItemHasChildren(hSubItem))
	{
		hSubItem = GetChildItem(hSubItem);
		SortTree(hSubItem);
	}
	hSubItem = GetNextSiblingItem(BrotherItem);
	KG_PROCESS_ERROR(hSubItem);

	SortTree(hSubItem);
Exit0:
	return ;
}
开发者ID:viticm,项目名称:pap2,代码行数:25,代码来源:KGTreeCtrl.cpp


示例14: DClickTreeItem

void MyGameTreeCtrl::DClickTreeItem( HTREEITEM htree)
{
	if(ItemHasChildren(htree))
		return ;
	m_iCurItem = GetItemData(htree);
	SearchTreeItem( htree );
}
开发者ID:2Dou,项目名称:PlayBox,代码行数:7,代码来源:MyGameTreeCtrl.cpp


示例15: SortChildrenCB

// Recursively sort the entire tree
void CMultiSelTreeCtrl::SortTree(HTREEITEM topNode/*=NULL*/, HTREEITEM parentNode/*=NULL*/)
{
	HTREEITEM item;

	// Sort things at the this level
	if (parentNode && (m_SortByExtension || m_SortByResolveStat 
					|| m_SortByAction    || m_SortByFilename))
	{
		TVSORTCB tvsortcb;
		tvsortcb.hParent = topNode;
		tvsortcb.lParam = (m_SortByResolveStat ? 2 : 0) + (m_SortByExtension ? 1 : 0) 
						+ (m_SortByFilename ? 8 : 0)    + (m_SortByAction ? 4 : 0);
		tvsortcb.lpfnCompare = SortTreeCB;
		SortChildrenCB(&tvsortcb);
	}
	else 
		SortChildren(topNode);

	// Get the first item at this level
	if(topNode == NULL)
		item=GetNextItem(TVI_ROOT, TVGN_ROOT);
	else
		item=GetChildItem(topNode);   // Get first child

	// Recurse all items that have children
	while(item != NULL)
	{
		if(ItemHasChildren(item))
			SortTree(item, topNode);
		item=GetNextSiblingItem(item);
	}
}
开发者ID:danieljennings,项目名称:p4win,代码行数:33,代码来源:MSTreeCtrl.cpp


示例16: while

BOOL COXTreeItem::SortChildren(int nCol/*=0*/, 
							   BOOL bOnlyChildren/*=TRUE*/, 
							   BOOL bAscending/*=TRUE*/, 
							   PFNTVCOMPARE lpfnCompare/*=NULL*/, 
							   LPARAM lParam/*=NULL*/)
{
	if(!ItemHasChildren())
	{
		return TRUE;
	}

	BOOL bNotDone = TRUE;
	while (bNotDone)
	{      
		bNotDone = FALSE;	
		COXTreeItem* xti=pxFirstChild;
		BOOL bFirstChild=TRUE;
		while(xti && xti->pxNext)
		{
			BOOL bResult;
			if(lpfnCompare==NULL)
			{
				bResult=Compare(xti,nCol,bAscending);
			}
			else
			{
				bResult=lpfnCompare(xti->m_tvi.lParam,xti->pxNext->m_tvi.lParam,lParam)*
					(bAscending ? 1 : -1)>0 ? TRUE : FALSE;
			}
			bNotDone|=bResult;
			if(bResult)
			{
				Swap(xti);
				if(bFirstChild)
				{
					pxFirstChild=xti->pxPrev;
				}
				xti=xti->pxPrev;
			}
			xti=xti->pxNext;
			bFirstChild=FALSE;
		}
	}

	if(!bOnlyChildren)
	{
		COXTreeItem* xti=pxFirstChild;
		while(xti)
		{
			if(xti->ItemHasChildren())
			{
				xti->SortChildren(nCol,bOnlyChildren,bAscending,
					lpfnCompare,lParam);
			}
			xti=xti->pxNext;
		}
	}

	return TRUE;
}
开发者ID:drupalhunter-team,项目名称:TrackMonitor,代码行数:60,代码来源:OXTreeItem.cpp


示例17: SortChildrenCB

// Recursively sorts a node and its children using an application
// specific sorting function
void CMyTreeCtrl::SortNodeAndChildren(HTREEITEM hItem, PFNTVCOMPARE lpfnCompare)
{
	// Create the sorting structure
	TVSORTCB sort;
	sort.hParent=hItem;
	sort.lParam=0;
	sort.lpfnCompare=lpfnCompare;

	// Sort the node
	SortChildrenCB(&sort);

	// Determine if this item has children
	if (ItemHasChildren(hItem))
	{
		// Get the first child item
		HTREEITEM hChild=GetChildItem(hItem);

		// Sort the child
		SortNodeAndChildren(hChild, lpfnCompare);

		// Sort the rest of the children
		HTREEITEM hSibling=GetNextSiblingItem(hChild);
		while (hSibling)
		{
			SortNodeAndChildren(hSibling, lpfnCompare);
			hSibling=GetNextSiblingItem(hSibling);
		}
	}
}
开发者ID:Joincheng,项目名称:lithtech,代码行数:31,代码来源:mtreectl.cpp


示例18: GetParentItem

void CViewTree::OnLButtonDblClk(UINT nFlags, CPoint point)
{
	// TODO: Add your message handler code here and/or call default
	//::MessageBox(NULL,_T("双击ViewTree"),_T("OK"),MB_OK);
	HTREEITEM  temp = this->GetSelectedItem();
	HTREEITEM parentitem = GetParentItem(temp);
	if (!ItemHasChildren(temp)){
		CString str = GetItemText(temp);
		CString parentname = GetItemText(parentitem);
		char path[256] ;
		GetCurrentDirectory(256,path);
		
		//CString pathstring = path;
		CString pathstring = workspace;
		// 根据根目录设置路径
		if (parentname.Left(4) == "SPIN"){
			pathstring.Append("\\spin\\");
		}
		if (parentname.Left(4) == "Effe"){
			pathstring.Append("\\piez\\");
		}
		//::MessageBox(NULL,_T(pathstring+str),_T("OK"),MB_OK);
		if (str.Right(3)==_T("bmp")){
			((CPMPApp *)AfxGetApp())->m_pBmpDocTemplate->OpenDocumentFile(pathstring+str);
		}else{
			// 其他格式一律用文本编辑器打开
			((CPMPApp *)AfxGetApp())->m_pTxtDocTemplate->OpenDocumentFile(pathstring+str);
		}
	}
	CTreeCtrl::OnLButtonDblClk(nFlags, point);
}
开发者ID:yeehlin,项目名称:PMP,代码行数:31,代码来源:ViewTree.cpp


示例19: GetParentItem

void CCheckBoxTree::vSetCheckParent(HTREEITEM hItem)
{
    if(hItem == nullptr)
    {
        return;
    }

    HTREEITEM hParentItem = GetParentItem(hItem);
    HTREEITEM hChildItem;
    BOOL bAllChecked = TRUE;
    if( ItemHasChildren(hParentItem))
    {
        hChildItem = GetChildItem(hParentItem);
        while(hChildItem)
        {
            if(!bIsItemChecked(hChildItem))
            {
                bAllChecked = FALSE;
                break;
            }
            hChildItem = GetNextSiblingItem(hChildItem);
        }
    }
    BOOL fCheck=0;
    vSetCheck(hParentItem, bAllChecked);
    vSetCheckParent(hParentItem);
    vSetCheckChildren(hParentItem,!fCheck);
}
开发者ID:ETAS-Nithin,项目名称:busmaster,代码行数:28,代码来源:CheckBoxTree.cpp


示例20: OnEndDrag

void SkillObjectTree::OnEndDrag(wxTreeEvent& event)
{
	wxTreeItemId itemSrc = m_draggedItem,
		itemDst = event.GetItem();
	m_draggedItem = (wxTreeItemId)0l;

	// where to copy the item?
	if ( itemDst.IsOk() && !ItemHasChildren(itemDst) )
	{
		// copy to the parent then
		itemDst = GetItemParent(itemDst);
	}

	if ( !itemDst.IsOk() )
	{
		wxLogMessage(wxT("OnEndDrag: can't drop here."));

		return;
	}

	wxString text = GetItemText(itemSrc);
	wxLogMessage(wxT("OnEndDrag: '%s' copied to '%s'."),
		text.c_str(), GetItemText(itemDst).c_str());

	// just do append here - we could also insert it just before/after the item
	// on which it was dropped, but this requires slightly more work... we also
	// completely ignore the client data and icon of the old item but could
	// copy them as well.
	//
	// Finally, we only copy one item here but we might copy the entire tree if
	// we were dragging a folder.
	//int image = wxGetApp().ShowImages() ? TreeCtrlIcon_File : -1;
	//AppendItem(itemDst, text, image);
}
开发者ID:jjiezheng,项目名称:pap_full,代码行数:34,代码来源:SkillObjectTree.cpp



注:本文中的ItemHasChildren函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ ItemIdGetLength函数代码示例发布时间:2022-05-30
下一篇:
C++ Item函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap