Exemple #1
0
void CTypeLibTreeView::OnTreeItemExpanding(NMHDR* pNMHDR, LRESULT* pResult)
{
	*pResult = 0 ;
	NM_TREEVIEW* pnmtv = (NM_TREEVIEW*)pNMHDR;

	if ((pnmtv->action != TVE_EXPAND && pnmtv->itemNew.lParam) ||
		(pnmtv->itemNew.state & TVIS_EXPANDEDONCE))
		return ;

	CTreeItem*  pItem = (CTreeItem*)pnmtv->itemNew.lParam ;
	if (pItem == NULL)
		return ;
	ASSERT(pItem->IsKindOf(RUNTIME_CLASS(CTreeItem)));

	BeginWaitCursor() ;
	m_tree.SetRedraw( FALSE ) ;

	*pResult = !pItem->Expand(  pnmtv->itemNew.hItem ) ;

	// No children
	if (*pResult == TRUE)
	{
		TV_ITEM item ;
		item.cChildren = 0 ;
		item.mask = TVIF_CHILDREN ;
		item.hItem = pnmtv->itemNew.hItem ;
		m_tree.SetItem( &item ) ;
	}

	m_tree.SetRedraw( TRUE ) ;
	EndWaitCursor() ;
}
Exemple #2
0
inline void CTypeLibTreeView::OnTreeDeleteItem(NMHDR* pNMHDR, LRESULT* pResult)
{
	*pResult = (LRESULT)TRUE ;
	NM_TREEVIEW* pnmtv = (NM_TREEVIEW*)pNMHDR;

	if (pnmtv->itemOld.lParam)
	{
		CTreeItem* pItem = (CTreeItem*)pnmtv->itemOld.lParam ;
		ASSERT(pItem->IsKindOf(RUNTIME_CLASS(CTreeItem)));
		delete pItem ;
		//pnmtv->itemOld.lParam = NULL ;
	}

}
Exemple #3
0
void CTypeLibTreeView::OnTreeSelchanged(NMHDR* pNMHDR, LRESULT* pResult)
{
	NM_TREEVIEW* pnmtv = (NM_TREEVIEW*)pNMHDR;
	*pResult = 0;

	CTypeLibWnd* pFrame = (CTypeLibWnd*)GetParent()->GetParent() ;
	ASSERT(pFrame->IsKindOf(RUNTIME_CLASS(CTypeLibWnd)));

	CTreeItem*  pItem = (CTreeItem*)pnmtv->itemNew.lParam ;
	if (pItem == NULL)
		return ;
	ASSERT(pItem->IsKindOf(RUNTIME_CLASS(CTreeItem)));

	pFrame->m_pSelectedItem = pItem ;

	pFrame->UpdateAllViews( this, UPDF_NOTREEVIEW, pItem ) ;
}