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

C++ GetRootItem函数代码示例

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

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



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

示例1: wxGetTextFromUser

void PartitioningTreeCtrl::onadd_h(wxCommandEvent& event)
{
	wxString cid= wxGetTextFromUser("Enter a usagename of homeplacement","Usagename",
	"", this,-1,-1,TRUE);
	wxString text="Homeplacement(";
	text.Append(cid);
	text.Append(")");
	wxTreeItemId itemid = AppendItem(GetSelection(),text,
		TreeCtrlIcon_Folder,TreeCtrlIcon_FolderSelected,NULL);
	Expand(GetRootItem());
	Refresh();
	ItemTyp itype;
	itype.itemid=itemid;
	itype.type=home;
	itype.usagename=cid;

	itemtypes.push_back(itype);

}
开发者ID:BackupTheBerlios,项目名称:qedo-svn,代码行数:19,代码来源:PartitioningTreeCtrl.cpp


示例2: wxTreeItemId

void BFBackupTree::Init ()
{
    lastItemId_ = wxTreeItemId();

    Freeze();

    // recreate the treeCtrl with all tasks
    BFBackup::Instance().InitThat(this);

    // expand all items in the treeCtlr
    ExpandAll();

	if ( lastItemId_.IsOk() )
		SelectItem(lastItemId_);
	else
		SelectItem(GetRootItem());

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


示例3: GetDriveItems

void CDirstatDoc::OnViewShowunknown()
{
    CArray<CItem *, CItem *> drives;
    GetDriveItems(drives);

    if(m_showUnknown)
    {
        for(int i = 0; i < drives.GetSize(); i++)
        {
            CItem *unknown = drives[i]->FindUnknownItem();
            ASSERT(unknown != NULL);

            // FIXME: Multi-select
            if(GetSelection(0) == unknown)
            {
                SetSelection(unknown->GetParent());
            }

            if(GetZoomItem() == unknown)
            {
                m_zoomItem = unknown->GetParent();
            }

            drives[i]->RemoveUnknownItem();
        }
        m_showUnknown = false;
    }
    else
    {
        for(int i = 0; i < drives.GetSize(); i++)
        {
            drives[i]->CreateUnknownItem();
        }
        m_showUnknown = true;
    }

    if(drives.GetSize() > 0)
    {
        SetWorkingItem(GetRootItem());
    }

    UpdateAllViews(NULL);
}
开发者ID:JDuverge,项目名称:windirstat,代码行数:43,代码来源:dirstatdoc.cpp


示例4: GetItemText

void browsers::CellBrowser::ShowMenu(wxTreeItemId id, const wxPoint& pt) {
    wxMenu menu;
    RBcellID = id;
    if ( id.IsOk() && (id != GetRootItem()))   {
      wxString RBcellname = GetItemText(id);
      menu.Append(CELLTREEOPENCELL, wxT("Open " + RBcellname));
      menu.Append(tui::TMCELL_REF_B , wxT("Add reference to " + RBcellname));
      menu.Append(tui::TMCELL_AREF_B, wxT("Add array of " + RBcellname));
      wxString ost;
      ost << wxT("export ") << RBcellname << wxT(" to GDS");
      menu.Append(tui::TMGDS_EXPORTC, ost);
      menu.Append(tui::TMCELL_REPORTLAY, wxT("Report layers used in " + RBcellname));
    }
    else {
      menu.Append(tui::TMCELL_NEW, wxT("New cell")); // will be catched up in toped.cpp
      menu.Append(tui::TMGDS_EXPORTL, wxT("GDS export"));
    }
    PopupMenu(&menu, pt);
}
开发者ID:BackupTheBerlios,项目名称:toped-svn,代码行数:19,代码来源:browsers.cpp


示例5: Freeze

void wxTreeCtrlBase::ExpandAllChildren(const wxTreeItemId& item)
{
    Freeze();
    // expand this item first, this might result in its children being added on
    // the fly
    if ( item != GetRootItem() || !HasFlag(wxTR_HIDE_ROOT) )
        Expand(item);
    //else: expanding hidden root item is unsupported and unnecessary

    // then (recursively) expand all the children
    wxTreeItemIdValue cookie;
    for ( wxTreeItemId idCurr = GetFirstChild(item, cookie);
          idCurr.IsOk();
          idCurr = GetNextChild(item, cookie) )
    {
        ExpandAllChildren(idCurr);
    }
    Thaw();
}
开发者ID:AaronDP,项目名称:wxWidgets,代码行数:19,代码来源:treebase.cpp


示例6: GetRootItem

wxTreeItemId DirectoryTree::PopulatePath(const wxString& sPath)
  {
  wxString sSeparator = wxFileName::GetPathSeparator();
  wxChar chSeparator = sSeparator.GetChar(0);

  // Ensure path finishes in path separator
	wxString sTerminatedPath = sPath;
  if(sTerminatedPath.Right(1) != sSeparator)
    sTerminatedPath += sSeparator;

  // Start from root path
  wxTreeItemId tid = GetRootItem(sPath);
	if(!tid.IsOk())
    {
    wxLogDebug(wxT("DirectoryTree::PopulatePath(): GetRootItem(sPath) failed;"), (int) tid);
    return wxTreeItemId(); 
    }

  sTerminatedPath = sTerminatedPath.AfterFirst(chSeparator);
  while(sTerminatedPath != wxT(""))
    {
		// Ensure all children exist
		AddChildren(tid);

		// Select the sub-directory
    wxString sDir = sTerminatedPath.BeforeFirst(chSeparator);
    wxLogTrace(DIRECTORYTREE_EVENTS, wxT("CreatePath(): Directory '%s'"), sDir.c_str());
    wxTreeItemId tidChild = GetChildByName(tid, sDir);
		// Fail if we can't find the sub-directory
    if(!tidChild.IsOk())
			{
			wxLogTrace(DIRECTORYTREE_EVENTS, wxT("CreatePath(): GetChildByName(%u, '%s') failed"), (int) tid, sDir.c_str());
			break;
			}

    sTerminatedPath = sTerminatedPath.AfterFirst(chSeparator);
    tid = tidChild;
    }
	
	// Return the item
  return tid;
  }
开发者ID:joeyates,项目名称:sherpa,代码行数:42,代码来源:DirectoryTree.cpp


示例7: update_locker

wxSize AutoResizingTreeCtrl::DoGetBestSize() const
{
    AutoResizingTreeCtrl& myself = const_cast<AutoResizingTreeCtrl&>(*this);
    wxWindowUpdateLocker update_locker(&myself);

    wxSize best_size(0, 0);

    wxTreeItemId const selection = GetSelection();
    wxTreeItemId const first_visible = GetFirstVisibleItem();

    wxTreeItemId const root = GetRootItem();
    myself.DoGetBestSizePrivate(best_size, root, true);

    // need some minimal size even for an empty tree
    if(best_size.x == 0 || best_size.y == 0)
        {
        wxSize min_size = wxTreeCtrl::DoGetBestSize();

        if(best_size.x == 0)
            {
            best_size.x = min_size.x;
            }
        if(best_size.y == 0)
            {
            best_size.y = min_size.y;
            }
        }
    best_size += GetSize() - GetClientSize();

    if(selection.IsOk())
        {
        myself.SelectItem(selection);
        }
    if(first_visible.IsOk())
        {
        myself.ScrollTo(first_visible);
        }

    CacheBestSize(best_size);

    return best_size;
}
开发者ID:vadz,项目名称:lmi,代码行数:42,代码来源:multidimgrid_tools.cpp


示例8: GetRootItem

wxTreeItemId
SamplesTreeCtrl::getTreeItem( smp::Sample *sample ) const
{
	wxTreeItemId root = GetRootItem();

	wxTreeItemIdValue cookie;

	wxTreeItemId speakerItem = GetFirstChild( root, cookie );

	wxTreeItemId foundItem;
	while( speakerItem.IsOk() )
	{
		if ( (foundItem = getTreeItem( sample, speakerItem )).IsOk() )
			return foundItem;

		speakerItem = GetNextChild( root, cookie );
	}

	return foundItem;
}
开发者ID:rainChu,项目名称:ytp-king,代码行数:20,代码来源:SamplesTreeCtrl.cpp


示例9: GetRootItem

HTREEITEM CCWTreeCtrl::GetNextTreeItem(HTREEITEM hItem)
{
  if (NULL == hItem)
    return GetRootItem();

  // First, try to go to this item's 1st child
  HTREEITEM hReturn = GetChildItem(hItem);

  // If no more child items...
  while (hItem && !hReturn) {
    // Get this item's next sibling
    hReturn = GetNextSiblingItem(hItem);

    // If hReturn is NULL, then there are no sibling items, and we're on a leaf node.
    // Backtrack up the tree one level, and we'll look for a sibling on the next
    // iteration (or we'll reach the root and quit).
    hItem = GetParentItem(hItem);
  }
  return hReturn;
}
开发者ID:ByteRisc,项目名称:pwsafe,代码行数:20,代码来源:CWTreeCtrl.cpp


示例10: GetRootItem

// Select the tree item corresponding to the WORKSHEET_DATAITEM aItem
void DESIGN_TREE_FRAME::SelectCell( WORKSHEET_DATAITEM* aItem )
{
    wxTreeItemId        rootcell = GetRootItem();
    wxTreeItemIdValue   cookie;

    wxTreeItemId        cell = GetFirstChild( rootcell, cookie );

    while( cell.IsOk() )
    {
        DESIGN_TREE_ITEM_DATA* data = (DESIGN_TREE_ITEM_DATA*) GetItemData( cell );

        if( data->GetItem() == aItem )
        {
            SelectItem( cell );
            return;
        }

        cell = GetNextChild( rootcell, cookie );
    }
}
开发者ID:AlexanderBrevig,项目名称:kicad-source-mirror,代码行数:21,代码来源:design_tree_frame.cpp


示例11: GetRootItem

//选择粒子基本参数Item
void SkillObjectTree::SelectSkillSetting()
{
	wxTreeItemId rootId = GetRootItem();
	wxTreeItemIdValue idValue;
	wxTreeItemId childId = GetFirstChild(rootId,idValue);
	while(childId.IsOk())
	{
		SkillTreeItemData* pItemData = dynamic_cast<SkillTreeItemData*>(GetItemData(childId)); 
		if(pItemData->GetDesc() == "Skill BasicSetting")
		{

			//SelectItem(childId);
			Expand(childId);
			mSelectSkillObject = NULL;
			break;
		}
		childId = GetNextSibling(childId);
	}

}
开发者ID:jjiezheng,项目名称:pap_full,代码行数:21,代码来源:SkillObjectTree.cpp


示例12: GetRootItem

/*
================
CPathTreeCtrl::SearchTree

Search the three using the search string.
Adds the matched tree items to the result tree.
Returns the number of items added to the result tree.
================
*/
int CPathTreeCtrl::SearchTree( treeItemCompare_t compare, void *data, CPathTreeCtrl &result ) {
	idPathTreeStack stack, searchStack;
	HTREEITEM item, child;
	idStr name;
	int id, numItems;

	numItems = 0;
	result.DeleteAllItems();
	stack.PushRoot( NULL );

	item = GetRootItem();
	searchStack.PushRoot( item );
	id = 0;

	while( searchStack.Num() > 0 ) {

		for ( child = GetChildItem( item ); child; child = GetChildItem( child ) ) {
			searchStack.Push( item, GetItemText( item ) );
			item = child;
		}

		name = searchStack.TopName();
		name += GetItemText( item );
		id = GetItemData( item );

		if ( compare( data, item, name ) ) {
			result.AddPathToTree( name, id, stack );
			numItems++;
		}

		for ( item = GetNextSiblingItem( item ); item == NULL;  ) {
			item = GetNextSiblingItem( searchStack.TopItem() );
			searchStack.Pop();
			if ( searchStack.Num() <= 0 ) {
				return numItems;
			}
		}
	}

	return numItems;
}
开发者ID:BielBdeLuna,项目名称:StormEngine2,代码行数:50,代码来源:CPathTreeCtrl.cpp


示例13: GetRootItem

 int SMCTreeCtrl::InsertColumn(int iCol,int nWid)
 {
     if(iCol < 0) iCol = m_arrColWidth.GetCount();
     m_arrColWidth.InsertAt(iCol,nWid);
     
     HSTREEITEM hItem = GetRootItem();
     while(hItem)
     {
         MCITEM *pMcItem = (MCITEM*)STreeCtrl::GetItemData(hItem);
         pMcItem->arrText.InsertAt(iCol,SStringT());
         hItem = GetNextItem(hItem);
     }
     m_nItemWid = -1;
     CalcItemWidth(0);
     
     CSize szView = GetViewSize();
     szView.cx = m_nItemWid;
     SetViewSize(szView);
     Invalidate();
     return iCol;
 }
开发者ID:435420057,项目名称:soui,代码行数:21,代码来源:STreeList.cpp


示例14: OnBeginDrag

void SkillObjectTree::OnBeginDrag(wxTreeEvent& event)
{
	// need to explicitly allow drag
	if ( event.GetItem() != GetRootItem() )
	{
		m_draggedItem = event.GetItem();

		wxPoint clientpt = event.GetPoint();
		wxPoint screenpt = ClientToScreen(clientpt);

		//wxLogMessage(wxT("OnBeginDrag: started dragging %s at screen coords (%i,%i)"),
		//	GetItemText(m_draggedItem).c_str(),
		//	screenpt.x, screenpt.y);

		event.Allow();
	}
	else
	{
		//wxLogMessage(wxT("OnBeginDrag: this item can't be dragged."));
	}
}
开发者ID:jjiezheng,项目名称:pap_full,代码行数:21,代码来源:SkillObjectTree.cpp


示例15: GetRootItem

// Collapse all the tree sections.  This is recursive
// so that we can collapse submenus.  SetRedraw should
// be FALSE while this is executing.
void CStatisticsTree::CollapseAll(HTREEITEM theItem)
{
	HTREEITEM hCurrent;

	if (theItem == NULL) {
		hCurrent = GetRootItem();
		m_bExpandingAll = true;
	}
	else
		hCurrent = theItem;

	while (hCurrent != NULL)
	{
		if (ItemHasChildren(hCurrent))
			CollapseAll(GetChildItem(hCurrent));
		Expand(hCurrent, TVE_COLLAPSE);
		hCurrent = GetNextItem(hCurrent, TVGN_NEXT);
	}

	if (theItem == NULL) m_bExpandingAll = false;
}
开发者ID:axxapp,项目名称:winxgui,代码行数:24,代码来源:StatisticsTree.cpp


示例16: GetRootItem

void BulletTree::SelectElementItem(Fairy::EffectElement* element)
{
	wxTreeItemId rootId = GetRootItem();
	wxTreeItemIdValue idValue;
	wxTreeItemId subId;
	wxTreeItemId childId = GetFirstChild(rootId,idValue);

	while(childId.IsOk())
	{
		BulletTreeItemData* pItemData = dynamic_cast<BulletTreeItemData*>(GetItemData(childId)); 
		Fairy::EffectElement* pElement = (Fairy::EffectElement*)pItemData->GetData();
		if(pItemData->GetDesc() == "Effect element" && pElement == element)
		{
			this->SelectItem(childId);
			this->Expand(childId);
			return;
		}
		childId = GetNextSibling(childId);
	}

}
开发者ID:jjiezheng,项目名称:pap_full,代码行数:21,代码来源:BulletTree.cpp


示例17: TreeModelBase

//[-------------------------------------------------------]
//[ Public functions                                      ]
//[-------------------------------------------------------]
ClassInfoModel::ClassInfoModel(QObject *parent): TreeModelBase(new HeaderTreeItem, parent),
	m_pCommonCategory(nullptr),
	m_pAttributeCategory(nullptr),
	m_pSlotsCategory(nullptr),
	m_pSignalsCategory(nullptr),
	m_pPropertiesCategory(nullptr),
	m_pConstructorsCategory(nullptr),
	m_pMethodsCategory(nullptr)
{
	QStringList headerItems;
	headerItems << "Category";

	HeaderTreeItem *header = static_cast<HeaderTreeItem*>(GetRootItem());
	header->setHeaderItems(headerItems);

	m_pCommonCategory = new ClassInfoCategoryTreeItem("Common", GetRootItem());
	m_pAttributeCategory = new ClassInfoCategoryTreeItem("Attributes", GetRootItem());
	m_pSlotsCategory = new ClassInfoCategoryTreeItem("Slots", GetRootItem());
	m_pSignalsCategory = new ClassInfoCategoryTreeItem("Signals", GetRootItem());
	m_pPropertiesCategory = new ClassInfoCategoryTreeItem("Properties", GetRootItem());
	m_pConstructorsCategory = new ClassInfoCategoryTreeItem("Constructors", GetRootItem());
	m_pMethodsCategory = new ClassInfoCategoryTreeItem("Methods", GetRootItem());
}
开发者ID:ByeDream,项目名称:pixellight,代码行数:26,代码来源:ClassInfoModel.cpp


示例18: GetRootItem

wxTreeItemId svSymbolTree::DoAddIncludeFiles(const wxFileName& fn, const fcFileOpener::List_t& includes)
{
    wxTreeItemId root = GetRootItem();

    if(root.IsOk() == false)
        return wxTreeItemId();

    if( root.IsOk() && ItemHasChildren(root) ) {
        wxTreeItemIdValue cookie;
        wxTreeItemId child = GetFirstChild(root, cookie);
        while ( child.IsOk() ) {

            // Dont add duplicate items
            if ( GetItemText(child) == INCLUDE_FILES_NODE_TEXT) {
                Delete(child);
                break;
            }
            child = GetNextChild(root, cookie);
        }
    }
    
    if( includes.empty() )
        return wxTreeItemId();

    wxTreeItemId item;
    if(ItemHasChildren(root)) {
        item = InsertItem(root, 0, INCLUDE_FILES_NODE_TEXT, 2, 2, new MyTreeItemData(INCLUDE_FILES_NODE_TEXT, wxEmptyString));

    } else {
        item = AppendItem(root, INCLUDE_FILES_NODE_TEXT, 2, 2, new MyTreeItemData(INCLUDE_FILES_NODE_TEXT, wxEmptyString));

    }

    fcFileOpener::List_t::const_iterator iter = includes.begin();
    for(; iter != includes.end(); ++iter) {
        wxString displayName( *iter );
        AppendItem(item, displayName, 16, 16, new MyTreeItemData(displayName, displayName) );
    }
    return item;
}
开发者ID:05storm26,项目名称:codelite,代码行数:40,代码来源:outline_symbol_tree.cpp


示例19: SearchCompanionItem

//寻找项
HTREEITEM CCompanionTreeCtrl::SearchCompanionItem(HTREEITEM hRootTreeItem, DWORD_PTR dwParam)
{
	//获取父项
	if (hRootTreeItem==NULL) hRootTreeItem=GetRootItem();
	if (hRootTreeItem==NULL) return NULL;

	//循环查找
	HTREEITEM hTreeItemTemp=NULL;
	do
	{
		if (GetItemData(hRootTreeItem)==dwParam) return hRootTreeItem;
		hTreeItemTemp=GetChildItem(hRootTreeItem);
		if (hTreeItemTemp!=NULL)
		{
			hTreeItemTemp=SearchCompanionItem(hTreeItemTemp,dwParam);
			if (hTreeItemTemp!=NULL) return hTreeItemTemp;
		}
		hRootTreeItem=GetNextItem(hRootTreeItem,TVGN_NEXT);
	} while (hRootTreeItem!=NULL);

	return NULL;
}
开发者ID:275958081,项目名称:netfox,代码行数:23,代码来源:CompanionTreeCtrl.cpp


示例20: GetCount

HTREEITEM KGTreeCtrl::FindNextItembySubString(CString strText, HTREEITEM hTreeItem)
{
	//没有数据返回NULL
	int nCount = GetCount();
	if ( !nCount ) return NULL;
	
	HTREEITEM FindNode = NULL;

	if (!hTreeItem)
		hTreeItem = GetRootItem();

	if (ItemHasChildren(hTreeItem))
	{
		FindNode = GetChildItem(hTreeItem);
		FindNode = FindItembySubString(strText,FindNode);
		KG_PROCESS_SUCCESS(FindNode);
	}
	
	FindNode = GetNextSiblingItem(hTreeItem);
	if (FindNode)
	{
		FindNode = FindItembySubString(strText,FindNode);
		KG_PROCESS_SUCCESS(FindNode);
	}
	
	while((hTreeItem = GetParentItem(hTreeItem)) != 0)
	{
		FindNode = GetNextSiblingItem(hTreeItem);
		if (FindNode)
		{
			FindNode = FindItembySubString(strText,FindNode);
			KG_PROCESS_SUCCESS(FindNode);
		}
	}
	
	return NULL;
Exit1:
	return FindNode;
}
开发者ID:viticm,项目名称:pap2,代码行数:39,代码来源:KGTreeCtrl.cpp



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ GetRotation函数代码示例发布时间:2022-05-30
下一篇:
C++ GetRootComponent函数代码示例发布时间: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