本文整理汇总了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();
}
}
示例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();
};
}
示例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;
}
示例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();
}
}