void Gobby::EncodingSelector::remove_text(const Glib::ustring& text)
{
	Glib::RefPtr<Gtk::ListStore> list =
		Glib::RefPtr<Gtk::ListStore>::cast_dynamic(get_model());

	if(!list)
	{
		throw std::logic_error(
			"Gobby::EncodingSelector::remove_text:\n"
			"Underlaying TreeModel is not a liststore"
		);
	}

	Gtk::TreeNodeChildren children = list->children();

	Gtk::TreeIter next_iter;
	for(Gtk::TreeIter iter = children.begin();
	    iter != children.end();
	    iter = next_iter)
	{
		next_iter = iter;
		++ next_iter;

		if( (*iter)[m_text_columns.m_column] == text)
			iter = list->erase(iter);
	}
}
void
LivePathEffectEditor::selectInList(LivePathEffect::Effect* effect)
{
    Gtk::TreeNodeChildren chi = effectlist_view.get_model()->children();
    for (Gtk::TreeIter ci = chi.begin() ; ci != chi.end(); ci++) {
        if (ci->get_value(columns.lperef)->lpeobject->get_lpe() == effect)
            effectlist_view.get_selection()->select(ci);
    }
}
void JsCompressorFrame::iter_filelist() {
	this->files.clear();
	Gtk::TreeNodeChildren child = this->m_filePreviewStore->children();
	Gtk::TreeModel::iterator it;
	for (it = child.begin(); it != child.end(); it++) {
		Gtk::TreeRow row = *it;
		this->files.push_back(
				row[this->m_filePreviewStore->m_colsDef.m_file_full_path]);
	}
}
Example #4
0
void PluginDisplay::on_select_all(bool v) {
    int d = 0;
    Gtk::TreeNodeChildren ch = plugin_liststore->children();
    for (Gtk::TreeIter it = ch.begin(); it != ch.end(); ++it) {
	it->set_value(plugin_liststore->col.active, v);
	d += it->get_value(plugin_liststore->col.pdesc)->set_active(v);
    }
    if (d) {
	change_count += d;
	set_title();
    }
}
		device_option_map_t get_device_map()
		{
			device_option_map_t devmap;

			Gtk::TreeNodeChildren children = model->children();
			for (Gtk::TreeNodeChildren::iterator iter = children.begin(); iter != children.end(); ++iter) {
				Gtk::TreeModel::Row row = *iter;
				if (devmap.find(row[col_device_real]) == devmap.end())
					devmap[row[col_device_real]] = row[col_parameters];
			}

			return devmap;
		}
Example #6
0
void PluginDisplay::on_reordered(const Gtk::TreePath& path) {
    assert(current_plugin);
    std::map<int,int> d;
    for (unsigned int i = 0; i < current_plugin->ctrl_ports.size(); ++i) {
	d[current_plugin->ctrl_ports[i]->pos] = i;
    }
    std::vector<PortDesc*> l;
    Gtk::TreeNodeChildren ch = port_liststore->children();
    for (Gtk::TreeIter it = ch.begin(); it != ch.end(); ++it) {
	l.push_back(current_plugin->ctrl_ports[d[it->get_value(port_liststore->col.pos)]]);
    }
    current_plugin->ctrl_ports = l;
}
Example #7
0
 /// <summary>
 /// Returns the Gtk.TreeIter that points to the specified Notebook.
 /// </summary>
 /// <param name="notebook">
 /// A <see cref="Notebook"/>
 /// </param>
 /// <param name="iter">
 /// A <see cref="Gtk.TreeIter"/>.  Will be set to a valid iter if
 /// the specified notebook is found.
 /// </param>
 /// <returns>
 /// A <see cref="System.Boolean"/>.  True if the specified notebook
 /// was found, false otherwise.
 /// </returns>
 bool NotebookManager::get_notebook_iter(const Notebook::Ptr & notebook, 
                                         Gtk::TreeIter & iter)
 {
   Gtk::TreeNodeChildren notebooks = m_notebooks_to_display->children();
   for (Gtk::TreeIter notebooks_iter = notebooks.begin();
        notebooks_iter != notebooks.end(); ++notebooks_iter) {
     Notebook::Ptr current_notebook;
     notebooks_iter->get_value(0, current_notebook);
     if (current_notebook == notebook) {
       iter = notebooks_iter;
       return true;
     }
   }
   
   iter = Gtk::TreeIter();
   return false;
 }
void control::on_data_changed(k3d::iunknown*)
{
	return_if_fail(m_implementation->m_model.get());

	const k3d::string_t value = m_implementation->m_model->value();

	const Gtk::TreeNodeChildren children = m_implementation->m_list_model->children();
	for(Gtk::TreeNodeChildren::const_iterator child = children.begin(); child != children.end(); ++child)
	{
		const k3d::string_t child_value = (*child)[m_implementation->m_columns.value];

		if(value == child_value)
		{
			set_active(child);
			return;
		}
	}

	k3d::log() << error << "Current enumeration value [" << value << "] does not match any allowed values" << std::endl;
}
Example #9
0
Gtk::TreeModel::Row EditStrategyWindow::findActionRow(rfiStrategy::Action *action)
{
	std::deque<Gtk::TreeModel::Row> rows;
	Gtk::TreeNodeChildren children = _store->children();
	for(Gtk::TreeModel::const_iterator iter = children.begin();iter!=children.end();++iter)
	{
		const Gtk::TreeModel::Row &row = (*iter);
		rows.push_back(row);
	}
	while(!rows.empty())
	{
		Gtk::TreeModel::Row row = rows.front();
		rows.pop_front();
		if(row[_columns.action] == action)
		{
			return row;
		}
		Gtk::TreeNodeChildren rowChildren = row.children();
		for(Gtk::TreeModel::const_iterator iter = rowChildren.begin();iter != rowChildren.end();++iter)
		{
			Gtk::TreeModel::Row childRow = *iter;
			rows.push_back(childRow);
		}
	}
	throw BadUsageException("Could not find row in view");
}
Example #10
0
void PluginDisplay::selection_changed() {
    Gtk::TreeIter it = treeview1->get_selection()->get_selected();
    PluginDesc *p = 0;
    if (it) {
	p = it->get_value(plugin_liststore->col.pdesc);
	if (current_plugin == p) {
	    return;
	}
    }
    save_current();
    on_reordered_conn.block();
    port_liststore->clear();
    on_reordered_conn.unblock();
    ladspa_category->set_text("");
    ladspa_maker->set_text("");
    ladspa_uniqueid->set_text("");
    plugin_name->set_text("");
    plugin_category->set_active(-1);
    plugin_quirks->set_active(-1);
    if (!p) {
	return;
    }
    set_old_state(p);
    if (p->shortname != p->Name) {
	plugin_name->modify_text(Gtk::STATE_NORMAL, Gdk::Color("red"));
    } else {
	plugin_name->unset_text(Gtk::STATE_NORMAL);
    }
    plugin_name->set_text(p->shortname);
    Gtk::TreeNodeChildren ch = plugin_category->get_model()->children();
    int i = 0;
    for (it = ch.begin(); it != ch.end(); ++it, ++i) {
	ustring cat;
	it->get_value(1, cat);
	if (cat == p->category) {
	    plugin_category->set_active(i);
	    break;
	}
    }
    ch = plugin_quirks->get_model()->children();
    for (i = 0, it = ch.begin(); it != ch.end(); ++it, ++i) {
	int quirks;
	it->get_value(1, quirks);
	if (quirks == p->quirks) {
	    plugin_quirks->set_active(i);
	    break;
	}
    }
    Glib::RefPtr<Gtk::ListStore> ls_master = Glib::RefPtr<Gtk::ListStore>::cast_dynamic(master_slider_idx->get_model());
    ls_master->clear();
    it = ls_master->append();
    i = -1;
    it->set_value(0, i);
    ustring ml("");
    for (unsigned int i = 0; i < p->ctrl_ports.size(); ++i) {
	it = ls_master->append();
	it->set_value(0, int(i));
	if (p->ctrl_ports[i]->pos == p->MasterIdx) {
	    ml = p->ctrl_ports[i]->factory.get_name();
	}
    }
    master_slider_idx->set_active(p->MasterIdx+1);
    master_slider_name->unset_text(Gtk::STATE_NORMAL);
    if (!p->MasterLabel.empty()) {
	master_slider_name->set_text(p->MasterLabel);
	if (p->MasterLabel != ml) {
	    master_slider_name->modify_text(Gtk::STATE_NORMAL, Gdk::Color("red"));
	}
    }
    dry_wet_button->set_active(current_plugin->add_wet_dry);
    ladspa_category->set_text(p->ladspa_category);
    ladspa_maker->set_text(p->Maker);
    if (p->is_lv2) {
	ladspa_uniqueid->set_text(ustring::compose("LV2: %1", p->path));
    } else {
	ladspa_uniqueid->set_text(ustring::compose("%1: %2[%3]", p->UniqueID, p->path, p->index));
    }
    for (unsigned int i = 0; i < p->ctrl_ports.size(); ++i) {
	PortDesc *q = p->ctrl_ports[i];
	Glib::RefPtr<Gtk::ListStore> tls;
	if (q->is_output) {
	    tls = output_type_list;
	} else if (q->has_sr) {
	    tls = display_type_list_sr;
	} else {
	    tls = display_type_list;
	}
	float dflt = q->get_dflt();
	float low = q->get_low();
	float up = q->get_up();
	if (q->has_sr && !q->use_sr) {
	    if (q->factory.is_set(ChangeableValues::dflt_set)) {
		dflt *= q->SR;
	    }
	    if (q->factory.is_set(ChangeableValues::low_set)) {
		low *= q->SR;
	    }
	    if (q->factory.is_set(ChangeableValues::up_set)) {
		up *= q->SR;
	    }
	}
	it = port_liststore->append();
	it->set_value(port_liststore->col.pos, q->pos);
	it->set_value(port_liststore->col.name, q->get_name());
	it->set_value(port_liststore->col.dflt, ustring::format(dflt));
	it->set_value(port_liststore->col.low, ustring::format(low));
	it->set_value(port_liststore->col.up, ustring::format(up));
	it->set_value(port_liststore->col.step, ustring(step_type_names[q->step]));
	it->set_value(port_liststore->col.display, ustring(display_type_names[q->get_tp()]));
	it->set_value(port_liststore->col.display_types, tls);
	it->set_value(port_liststore->col.port, q);
	it->set_value(port_liststore->col.newrow, q->get_newrow());
	it->set_value(port_liststore->col.use_sr, q->has_sr && !q->use_sr);
	it->set_value(port_liststore->col.has_caption, q->has_caption);
    }
}