当前位置: 首页>>代码示例>>C++>>正文


C++ TreeViewItem::GetParent方法代码示例

本文整理汇总了C++中TreeViewItem::GetParent方法的典型用法代码示例。如果您正苦于以下问题:C++ TreeViewItem::GetParent方法的具体用法?C++ TreeViewItem::GetParent怎么用?C++ TreeViewItem::GetParent使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在TreeViewItem的用法示例。


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

示例1: InsertObject

		virtual void InsertObject(void *root,void *userdata,void *obj,Int32 dragtype,void *dragobject,Int32 insertmode, Bool bCopy)
		{
			TreeView* pTree = (TreeView*)userdata;

			if (dragtype == DRAGTYPE_FILES)
			{
				Filename* fn = (Filename*)dragobject;
				if (!fn) return;
				((CTreeDialog*)pTree->m_pParent)->OpenDialog(*fn);
			}

			if (dragtype == pTree->m_lElementType)
			{
				TreeViewItem* pDragItem = (TreeViewItem*)dragobject;
				TreeViewItem* pDestItem = (TreeViewItem*)obj;

				if (bCopy)
				{
					if (!pDragItem || !pDestItem) return;

					CTreeDialog* pDlg = (CTreeDialog*)pTree->m_pParent;
					if (!pDlg) return;
					CDialogDoc* pDoc = pDlg->GetDocument();
					if (!pDoc) return;

					CDialogItem* pDlgItemDrag = (CDialogItem*)pDragItem->GetData()->GetVoid(TREEVIEW_DATA);
					CDialogItem* pDlgItemDrop = (CDialogItem*)pDestItem->GetData()->GetVoid(TREEVIEW_DATA);
					if (!pDlgItemDrag || !pDlgItemDrop) return;

					pDoc->ExportMacro(GeGetPluginPath() + String("DragDrop.dmf"), pDlgItemDrag);
					CDialogItem* pNewItem = pDoc->ImportMacro(GeGetPluginPath() + String("DragDrop.dmf"), pDlgItemDrop);
					GeFKill(GeGetPluginPath() + String("DragDrop.dmf"));

					if (pNewItem)
					{
						TreeViewItem* pNewTreeItem = pNewItem->m_pTreeViewItem;
						switch (insertmode)
						{
							case INSERT_BEFORE: pNewTreeItem->ChangeParent(pDestItem->GetParent(), pDestItem, nullptr); break;
							case INSERT_UNDER:  pNewTreeItem->ChangeParent(pDestItem, nullptr, nullptr); Open(root, userdata, obj, true); break;
							default:            pNewTreeItem->ChangeParent(pDestItem->GetParent(), nullptr, pDestItem); break;
						}
						Select(root, userdata, pNewTreeItem, SELECTION_NEW);
					}
				}
				else
				{
					switch (insertmode)
					{
						case INSERT_BEFORE: pDragItem->ChangeParent(pDestItem->GetParent(), pDestItem, nullptr); break;
						case INSERT_UNDER:  pDragItem->ChangeParent(pDestItem, nullptr, nullptr); Open(root, userdata, obj, true); break;
						default:            pDragItem->ChangeParent(pDestItem->GetParent(), nullptr, pDestItem); break;
					}
				}
				BaseContainer bc;
				bc.SetInt32(TREEVIEW_MESSAGE_TYPE, TREEVIEW_STRUCTURE_CHANGE);
				pTree->m_pParent->Command(pTree->m_lTreeID, bc);
				pTree->m_pTree->Refresh();
			}
		}
开发者ID:bonsak,项目名称:resedit,代码行数:60,代码来源:TreeView.cpp

示例2: MakeVisible

/*********************************************************************\
	Function name    : CDialogPreview::MakeVisible
	Description      :
	Created at       : 07.09.01, @ 16:14:42
	Created by       : Thomas Kunert
	Modified by      :
\*********************************************************************/
void CDialogPreview::MakeVisible(CDialogItem* pItem)
{
	TreeViewItem* pTreeItem = pItem->m_pTreeViewItem;
	Int32 lLastID = pItem->m_lID;
	CDialogItem* pSearchItem;

	while (pTreeItem)
	{
		pSearchItem = (CDialogItem*)pTreeItem->GetData()->GetVoid(TREEVIEW_DATA);
		if (pSearchItem)
		{
			if (((pSearchItem->GetType()) == Group) && (pSearchItem != pItem))
			{
				CDialogGroup* pGroup = (CDialogGroup*)pSearchItem;
				if (pGroup->m_lGroupType == GROUP_TYPE_TAB)
				{
					pGroup->m_lLastChildID = lLastID;
					m_wndSubDlg.SetInt32(pGroup->m_lID, lLastID);
				}
			}
			lLastID = pSearchItem->m_lID;
		}
		pTreeItem = pTreeItem->GetParent();
	};
}
开发者ID:phohale,项目名称:ResEdit,代码行数:32,代码来源:DialogPreview.cpp

示例3: IsChildOf

/*********************************************************************\
	Function name    : TreeViewItem::IsChildOf
	Description      : checks, if pItem is a child of this
	Created at       : 15.08.01, @ 11:37:53
	Created by       : Thomas Kunert
	Modified by      :
\*********************************************************************/
Bool TreeViewItem::IsChildOf(TreeViewItem* pItem)
{
	TreeViewItem* pParent = this;
	while (pParent)
	{
		if (pParent == pItem) return true;
		pParent = pParent->GetParent();
	}
	return false;
}
开发者ID:bonsak,项目名称:resedit,代码行数:17,代码来源:TreeView.cpp

示例4: SelectItem

/*********************************************************************\
	Function name    : TreeView::SelectItem
	Description      :
	Created at       : 14.08.01, @ 23:17:56
	Created by       : Thomas Kunert
	Modified by      :
\*********************************************************************/
void TreeView::SelectItem(TreeViewItem* pTreeItem)
{
	m_pCurrentItem = pTreeItem;

	TreeViewItem* pParent = pTreeItem->GetParent();
	while (pParent)
	{
		pParent->m_bIsExpanded = true;
		pParent = pParent->GetParent();
	};
	//m_VisibleItems.FreeList();
	if (m_bMayUpdate)
	{
		//CreateVisibleItemList();
		Redraw();
		//UpdateParentLayout();
	}
}
开发者ID:bonsak,项目名称:resedit,代码行数:25,代码来源:TreeView.cpp


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