newntui/discovermdi/src/simplifytree.cpp
//-----------------------------------------------------------------------------------------
// This will free all tree nodes and clean tree UI
//-----------------------------------------------------------------------------------------
This will free all tree nodes and clean tree UI
This will free all tree nodes and clean tree UI
void CSimplifyTree::ClearTree(HTREEITEM item) {
    if(item==NULL) return;
	CIncludeTreeNode * node;
 	node=(CIncludeTreeNode *)m_Tree.GetItemData(item);
	if(node) delete node;
    HTREEITEM child   = m_Tree.GetChildItem(item);
	if(child!=NULL)  ClearTree(child);
    HTREEITEM sibling = m_Tree.GetNextSiblingItem(item);
	if(sibling!=NULL)  ClearTree(sibling);
}
void CSimplifyTree :: ClearTree ( HTREEITEM item ) { if ( item == NULL ) return ; CIncludeTreeNode * node ; node = ( CIncludeTreeNode * ) m_Tree . GetItemData ( item ) ; if ( node ) delete node ; HTREEITEM child = m_Tree . GetChildItem ( item ) ; if ( child != NULL ) ClearTree ( child ) ; HTREEITEM sibling = m_Tree . GetNextSiblingItem ( item ) ; if ( sibling != NULL ) ClearTree ( sibling ) ; }
This will free all tree nodes and clean tree UI
This will free all tree nodes and clean tree UI
// We need a pointer to the user structure attached to the UI element.