Esempio n. 1
0
void HierTreeMdl::get_value_vfunc(const TreeModel::iterator& iter, int column, Glib::ValueBase& value) const
{
    if (IsIterValid(iter)) {
	if (column < iColRec.size()) {
	    GType coltype = get_column_type_vfunc(column);
	    if (column == HierTreeClrec::KCol_Name) {
		Glib::Value<Glib::ustring> sval;
		sval.init(coltype);
		Elem* node = (Elem*) iter.gobj()->user_data;
		//string data = node->EType() + ":" + node->Name();
		string data = node->Name();
		sval.set(data.c_str());
		value.init(coltype);
		value = sval;
	    }
	    else if (column == HierTreeClrec::KCol_Elem) {
		Glib::Value<Elem*> sval;
		sval.init(coltype);
		Elem* data = (Elem*) iter.gobj()->user_data;
		sval.set(data);
		value.init(coltype);
		value = sval;
	    }
	}
    }
}
Esempio n. 2
0
void HierTreeMdl::OnCompDeleting(Elem& aComp)
{
    std::cout << "HierTreeMdl::OnCompDeleting: [" << aComp.Name() << "]" << std::endl;
    //UpdateStamp();
    iterator iter;
    iter.set_stamp(iStamp);
    iter.gobj()->user_data = &aComp;
    Path path = get_path_vfunc(iter);
    row_deleted(path);
}
Esempio n. 3
0
void HierTreeMdl::OnCompAdding(Elem& aComp)
{
    std::cout << "HierTreeMdl::OnCompAdding: [" << aComp.Name() << "]" << std::endl;
    //UpdateStamp();
    // Nodify view of all the internal components. This is required because there is no
    // notif from internal comps - they are created before element gets inserted to the hier
    iterator iter;
    iter.set_stamp(iStamp);
    iter.gobj()->user_data = &aComp;
    Path path = get_path_vfunc(iter);
    row_inserted(path, iter);
    for (vector<Elem*>::iterator it = aComp.Comps().begin(); it != aComp.Comps().end(); it++) {
	OnCompAdding(*(*it));
    }
}