예제 #1
0
void PageDetail::InitJun(HTREEITEM hitem)
{
	CString strSubText; //节点名称
	CString strMainText;//节点类型名称
	CString strName;
    CString strType;
	int nNum = 0;
	int nKey;
	int nID;
	HTREEITEM hMainItem = NULL;
    HTREEITEM hSubItem = NULL;
	Component *pTemp = NULL;
	for(int i=1; i< 30; i++)
	{
		nNum = 0;
		IteratorPtr<Component> iteratorPtr(m_pCompManager->CreatJunIterator());
		hMainItem = m_tree.InsertItem(strMainText,hitem);
		for(iteratorPtr->Fist();!iteratorPtr->IsDone();iteratorPtr->Next())
		{
			pTemp = &iteratorPtr->CurrentItem();
			if(i == pTemp->GetID())
			{
				nKey = iteratorPtr->CurrentKey();
				nID = pTemp->GetKey();
				strName = pTemp->GetName(m_pScenario);
				strSubText.Format(_T("J%d(%s)"),nID,strName);
				hSubItem = m_tree.InsertItem(strSubText,hMainItem);
				m_tree.SetItemData(hSubItem,nKey);
				strType = pTemp->GetTypeName();
				nNum++;
			}
		}
		if(nNum != 0)
		{
			strMainText.Format(_T("%s(%d)"),strType,nNum);
			m_tree.SetItemText(hMainItem,strMainText);
			m_tree.SetItemData(hMainItem,2);
		}
		else
		{
			m_tree.DeleteItem(hMainItem);
		}
	}
}
예제 #2
0
void PageDetail::InitPipe(HTREEITEM hitem)
{
	CString strText;
	CString strName;
	int nKey;
	int nID;
	HTREEITEM hsubItem = NULL;
	Component *pTemp = NULL;
	IteratorPtr<Component> iteratorPtr(m_pCompManager->CreatPipeIterator());
	for(iteratorPtr->Fist();!iteratorPtr->IsDone();iteratorPtr->Next())
	{
		pTemp = &iteratorPtr->CurrentItem();
		nKey = iteratorPtr->CurrentKey();
		nID = pTemp->GetKey();
		strName = pTemp->GetName(m_pScenario);
		strText.Format(_T("P%d(%s)"),nID,strName);
		hsubItem = m_tree.InsertItem(strText,hitem);
		m_tree.SetItemData(hsubItem,nKey);
	}
}