void g_populate_tree ( HWND wnd_tree, cui::fcl::group_list & list, const cui::fcl::group_list_filtered & filtered, HTREEITEM ti_parent = TVI_ROOT) { t_size i, count = filtered.get_count(); for (i=0; i<count; i++) { pfc::string8 name; filtered[i]->get_name(name); HTREEITEM item = treeview::insert_item(wnd_tree, name, m_nodes.get_count() , ti_parent); m_nodes.add_item(t_node(item, filtered[i])); TreeView_SetCheckState(wnd_tree, item, TRUE); cui::fcl::group_list_filtered filtered2(list, filtered[i]->get_guid()); list.remove_by_guid(filtered[i]->get_guid()); g_populate_tree(wnd_tree, list, filtered2, item); } }
void DependencyGraph::AddDependency(std::string s, std::string t) { Node::Node s_node(""); Node::Node t_node(""); // check if s and t exist already as nodes try { s_node = GetNode(s); } // if not, create the node and add to list of nodes catch (std::exception& e) { s_node.SetName(s); nodes->push_back(s_node); } // repeat with t try { t_node = GetNode(t); } catch (std::exception& e) { t_node.SetName(t); nodes->push_back(t_node); } bool tDep = false; std::list<Node::Node>::iterator it; for(it = (s_node.dependents)->begin(); it != (s_node.dependents)->end(); ++it) { if ((*it).GetName().compare(t) == 0) { tDep = true; } } if (!tDep) { s_node.add_dependent(t_node); size++; } }