Example #1
0
void CvIpmLeft::OnItemexpanding(NMHDR* pNMHDR, LRESULT* pResult) 
{
	CTreeCtrl& tree = GetTreeCtrl();
	*pResult = 0;   // default to allow expanding

	CdIpmDoc* pDoc = (CdIpmDoc*)GetDocument();
	ASSERT(pDoc);
	if (!pDoc)
		return;
	// Manage "update all after load on first action"
	if (pDoc->GetPTreeGD()->CurrentlyLoading())
		return;
	if (pDoc->ManageMonSpecialState() || m_bProhibitActionOnTreeCtrl) 
	{
		*pResult = 1;   // do not allow expanding
		return;
	}

	NM_TREEVIEW* pNMTreeView = (NM_TREEVIEW*)pNMHDR;
	if (pNMTreeView->action == TVE_EXPAND) 
	{
		HTREEITEM hItem = pNMTreeView->itemNew.hItem;
		CTreeItem *pItem;
		pItem = (CTreeItem *)tree.GetItemData(hItem);
		if (pItem && !pItem->IsAlreadyExpanded())
		{
			if (pItem->CreateSubBranches(hItem))
				pItem->SetAlreadyExpanded(TRUE);
			else
				*pResult = 1;     // prevent expanding
		}
	}
}
Example #2
0
void CuResizableDlgBar::OnItemexpandingTree1(NMHDR* pNMHDR, LRESULT* pResult) 
{
	*pResult = 0;     // default to allow expanding
	NM_TREEVIEW* pNMTreeView = (NM_TREEVIEW*)pNMHDR;

	if (pNMTreeView->action == TVE_EXPAND) {
		HTREEITEM hItem = pNMTreeView->itemNew.hItem;
		CTreeItem *pItem;
		pItem = (CTreeItem *)m_Tree.GetItemData(hItem);
		if (pItem)
			if (!pItem->IsAlreadyExpanded()) {
				if (pItem->CreateSubBranches(hItem))
					 pItem->SetAlreadyExpanded(TRUE);
				else
					*pResult = 1;     // prevent expanding
			}
	}
	bSaveRecommended = TRUE;
}