void MessagesList::addMessage(const char* text) { OSTRINGSTREAM msg; msg<<text; Gtk::TreeModel::Row row = *(m_refListStore->append()); row.set_value(0, Glib::ustring(msg.str())); row[m_Columns.m_col_color] = Gdk::Color("#FFFFFF"); m_TreeView.scroll_to_row( m_refListStore->get_path(row)); }
void VRConceptWidget::on_select_property() { Gtk::TreeModel::iterator iter = treeview->get_selection()->get_selected(); if (!iter) return; VRGuiSemantics_PropsColumns cols; Gtk::TreeModel::Row row = *iter; int flag = row.get_value(cols.flag); selected_property = flag ? 0 : concept->getProperty( row.get_value(cols.prop) ); treeview->get_selection()->unselect_all(); // clear selection update(); }
void ProductoBox::actualizar(){ Gtk::TreeModel::iterator iter = selection -> get_selected(); if(!iter)return; Gtk::TreeModel::Row row = *iter; Glib::ustring nombre; Glib::ustring descripcion; Glib::ustring icono; row.get_value(0,nombre); row.get_value(1,descripcion); row.get_value(2,icono); setProducto(nombre,descripcion,icono); graficoDeBarras->vaciar(); }
void VRGuiNet_on_argip_edited(GtkCellRendererText *cell, gchar *path_string, gchar *ip, gpointer d) { Glib::RefPtr<Gtk::TreeView> tree_view = Glib::RefPtr<Gtk::TreeView>::cast_static(VRGuiBuilder()->get_object("treeview9")); Gtk::TreeModel::iterator iter = tree_view->get_selection()->get_selected(); if(!iter) return; // set the cell with new name VRGuiNet_SocketCols cols; Gtk::TreeModel::Row row = *iter; row[cols.ip] = ip; VRSocket* socket = (VRSocket*)row.get_value(cols.obj); socket->setIP(ip); }
void VRGuiNet_on_name_edited(GtkCellRendererText *cell, gchar *path_string, gchar *new_name, gpointer d) { Glib::RefPtr<Gtk::TreeView> tree_view = Glib::RefPtr<Gtk::TreeView>::cast_static(VRGuiBuilder()->get_object("treeview9")); Gtk::TreeModel::iterator iter = tree_view->get_selection()->get_selected(); if(!iter) return; // get selected socket VRGuiNet_SocketCols cols; Gtk::TreeModel::Row row = *iter; string name = row.get_value(cols.name); row[cols.name] = new_name; // update key in map VRSceneManager::getCurrent()->changeSocketName(name, new_name); }
/** Inicia las opcions basicas del menu de preferencias. */ void Preferencias::iniciadorPreferencias() { treeviewGeneral->set_headers_visible(false); refTreeModelDialog = Gtk::TreeStore::create(columModel); treeviewGeneral->set_model(refTreeModelDialog); Gtk::TreeModel::Row row; Gtk::TreeModel::Row childrow; row = *(refTreeModelDialog->append()); //row[columModel.nomCol] = "Clasificaciones"; row[columModel.nomCol] = "Classifications"; childrow = *(refTreeModelDialog->append(row.children())); //childrow[columModel.nomCol] = "Clases"; childrow[columModel.nomCol] = "Classes"; childrow = *(refTreeModelDialog->append(row.children())); //childrow[columModel.nomCol] = "Estados"; childrow[columModel.nomCol] = "States"; row = *(refTreeModelDialog->append()); //row[columModel.nomCol] = "Directorios"; row[columModel.nomCol] = "Folders"; row = *(refTreeModelDialog->append()); row[columModel.nomCol] = "Editor"; row = *(refTreeModelDialog->append()); //row[columModel.nomCol] = "Rejilla"; row[columModel.nomCol] = "Grid"; childrow = *(refTreeModelDialog->append(row.children())); //childrow[columModel.nomCol] = "Rejilla Completa"; childrow[columModel.nomCol] = "Complete grid"; childrow = *(refTreeModelDialog->append(row.children())); //childrow[columModel.nomCol] = "Rejilla Personalizada"; childrow[columModel.nomCol] = "Custom grid"; row = *(refTreeModelDialog->append()); //row[columModel.nomCol] = "Base de Datos"; row[columModel.nomCol] = "Database"; row = *(refTreeModelDialog->append()); row[columModel.nomCol] = "Secure FTP"; row = *(refTreeModelDialog->append()); //row[columModel.nomCol] = "Cache de imagenes"; row[columModel.nomCol] = "Image cache"; row = *(refTreeModelDialog->append()); treeviewGeneral->append_column("",columModel.nomCol); }
void ImportClassesBox::ClassesTreeView::on_drag_data_get( const Glib::RefPtr<Gdk::DragContext>& , Gtk::SelectionData& selection_data, guint, guint) { Glib::RefPtr<Gtk::TreeSelection> srcSelect(get_selection()); if (srcSelect) { Gtk::TreeModel::iterator iter = srcSelect->get_selected(); if (iter) { Gtk::TreeModel::Row row = *iter; std::string className = row.get_value(mColumns.m_col_name); selection_data.set(selection_data.get_target(), className); } } }
bool ApplicationList::addModule(Module* mod) { typedef Gtk::TreeModel::Children type_children; type_children modchild = m_modRow->children(); for(type_children::iterator itr = modchild.begin(); itr!= modchild.end(); ++itr) { Gtk::TreeModel::Row childrow = *itr; if(childrow[m_appColumns.m_col_name] == Glib::ustring(mod->getName())) return false; } Gtk::TreeModel::Row childrow = *(m_refTreeModel->append(m_modRow.children())); childrow[m_appColumns.m_col_type] = MODULE; childrow[m_appColumns.m_col_name] = mod->getName(); childrow[m_appColumns.m_col_filename] = mod->getXmlFile(); childrow.set_value(0, Gdk::Pixbuf::create_from_data(module_ico.pixel_data, Gdk::COLORSPACE_RGB, true, 8, module_ico.width, module_ico.height, module_ico.bytes_per_pixel*module_ico.width)); string fname; string fpath = mod->getXmlFile(); size_t pos = fpath.rfind(PATH_SEPERATOR); if(pos!=string::npos) fname = fpath.substr(pos+1); else fname = fpath; fname = fname + string(" (") + fpath + string(")"); Gtk::TreeModel::Row descrow = *(m_refTreeModel->append(childrow.children())); descrow[m_appColumns.m_col_type] = NODE_FILENAME; descrow[m_appColumns.m_col_name] = fname; descrow[m_appColumns.m_col_filename] = mod->getXmlFile(); descrow.set_value(0, Gdk::Pixbuf::create_from_data(document_ico.pixel_data, Gdk::COLORSPACE_RGB, true, 8, document_ico.width, document_ico.height, document_ico.bytes_per_pixel*document_ico.width)); return true; }
bool ApplicationList::addAppTemplate(AppTemplate* temp) { typedef Gtk::TreeModel::Children type_children; string fname = temp->name + string(" (") + temp->tmpFileName + string(")"); Gtk::TreeModel::Row descrow = *(m_refTreeModel->append(m_tempRow.children())); descrow[m_appColumns.m_col_type] = NODE_APPTEMPLATE; descrow[m_appColumns.m_col_name] = fname; descrow[m_appColumns.m_col_filename] = temp->tmpFileName; descrow.set_value(0, Gdk::Pixbuf::create_from_data(apptemplate_ico.pixel_data, Gdk::COLORSPACE_RGB, true, 8, apptemplate_ico.width, apptemplate_ico.height, apptemplate_ico.bytes_per_pixel*apptemplate_ico.width)); return true; }
void OpenModelingPluginBox::onApply() { Glib::RefPtr<Gtk::TreeView::Selection> refSelection = mTreeView->get_selection(); if (refSelection) { Gtk::TreeModel::iterator iter = refSelection->get_selected(); if (iter) { Gtk::TreeModel::Row row = *iter; mPluginName = row.get_value(mColumns.mName); mDialog->response(Gtk::RESPONSE_OK); } } mDialog->hide_all(); }
void ProductoBox::actualizarGrafico(){ utils::StringUtils util; std::string s_desde = selectorFecha->obtenerDesde(); std::string s_hasta = selectorFecha->obtenerHasta(); Glib::DateTime fecha1 = util.stringToDate(s_desde); Glib::DateTime fecha2 = util.stringToDate(s_hasta); if(fecha2.compare(fecha1) != 1){ Gtk::MessageDialog dialogo("La fecha final debe ser mayor a la fecha inicial",false,Gtk::MESSAGE_WARNING,Gtk::BUTTONS_OK); dialogo.run(); }else{ Gtk::TreeModel::iterator iter = selection -> get_selected(); if(!iter)return; Gtk::TreeModel::Row row = *iter; std::string pId = row.get_value(id); sig_stockHistoricoProducto.emit(pId,s_desde,s_hasta); } }
int getListStorePos(string ls, string s) { Gtk::TreeModel::iterator iter; Gtk::TreeModel::Row row; LStore_ModelColumns mcols; Glib::RefPtr<Gtk::ListStore> store = Glib::RefPtr<Gtk::ListStore>::cast_static(VRGuiBuilder()->get_object(ls.c_str())); int N = gtk_tree_model_iter_n_children( (GtkTreeModel*) store->gobj(), NULL ); for (int i=0; i<N; i++) { stringstream ss; ss << i; iter = store->get_iter(ss.str()); if (!iter) continue; row = *iter; string c = row.get_value(mcols.content); if (c == s) return i; } return -1; }
void ProductoBox::bajaProducto(){ Gtk::TreeModel::iterator iter = selection -> get_selected(); if(!iter)return; Gtk::MessageDialog dialogo("¿Esta seguro de que desea eliminar?",false,Gtk::MESSAGE_QUESTION,Gtk::BUTTONS_OK_CANCEL); dialogo.set_secondary_text("Seguro?"); int result = dialogo.run(); switch(result){ case Gtk::RESPONSE_OK:{ Gtk::TreeModel::Row row = *iter; Glib::ustring id1; id1 = row.get_value(id); sig_bajaProducto.emit(id1); break;} case Gtk::RESPONSE_CANCEL: break; } }
void file_chooser::on_file_type_changed () { Glib::RefPtr< Gtk::TreeSelection > s (file_type_.get_selection ()); if (!s) return; Gtk::TreeModel::iterator it (s->get_selected ()); if (!it) return; Gtk::TreeModel::Row r (*it); extension_list l (r[column->exts]); if (l.empty ()) { expander_.set_label (_("File Type")); } else { expander_.set_label ((format (_("File type: %1%")) % r.get_value (column->text)).str ()); if (!count (l.begin (), l.end (), get_current_extension ())) set_current_extension (l.front ()); } if (!single_image_mode_) { single_file_.set_sensitive (supports_multi_image (get_current_name ())); if (!supports_multi_image (get_current_name ())) { if (!regex_match (get_current_name (), filename_re)) { fs::path path (get_current_name ()); fs::path stem (path.stem ()); fs::path ext (path.extension ()); path = stem; path = path.native () + default_pattern_; path.replace_extension (ext); set_current_name (path.string ()); } } single_file_.set_active (requests_single_file (get_current_name ())); } }
void setup_model(){ { //treeview treemodel = Gtk::ListStore::create(columns); treeview1->set_model(treemodel); treeview1->append_column("Filename", columns.Filename); treeview1->append_column("Url", columns.url); treeview1->append_column("Size", columns.size); treeview1->append_column("%", columns.percentage_complete); treeview1->append_column("Time Left", columns.time_left); treeview1->append_column("Action", columns.action); //make all columns resizeable and set width std::vector<Gtk::TreeViewColumn*> tv_columns = treeview1->get_columns(); std::vector<Gtk::TreeViewColumn*>::iterator iter = tv_columns.begin(); int count = 0; for (; iter!=tv_columns.end(); iter++, count++){ Gtk::TreeViewColumn* col = *iter; col->set_resizable(true); col->set_fixed_width(column_widths[count]); } Gtk::TreeModel::Row row = *(treemodel->append()); row[columns.Filename] = "33"; row[columns.url] = "SFDSD"; Gtk::TreeModel::Children children = treemodel->children(); for(Gtk::TreeModel::Children::iterator iter = children.begin(); iter != children.end(); ++iter){ Gtk::TreeModel::Row row = *iter; row->set_value(0, (Glib::ustring)"asdfaksdhfakshdfklasjdfhklsafdhlaskjdhflksajdhfasdfads"); row->set_value(4, (Glib::ustring)"asdfads"); } } { comboboxmodel = Gtk::ListStore::create(combo_columns); combobox_size->set_model(comboboxmodel); Gtk::TreeModel::Row row = *(comboboxmodel->append()); combobox_size->set_id_column(0); Gtk::CellRendererText *cell = new Gtk::CellRendererText(); combobox_size->pack_start(*cell); combobox_size->add_attribute(*cell, "text", combo_columns.size); row[combo_columns.size] = "kB"; (*(comboboxmodel->append()))[combo_columns.size] = "MB"; combobox_size->set_active(0); } }
void VRGuiNet_on_argtype_edited(GtkCellRendererCombo* crc, gchar *path_string, GtkTreeIter *new_iter, gpointer d) { Glib::RefPtr<Gtk::TreeView> tree_view = Glib::RefPtr<Gtk::TreeView>::cast_static(VRGuiBuilder()->get_object("treeview9")); Gtk::TreeModel::iterator iter = tree_view->get_selection()->get_selected(); if(!iter) return; // set the cell with new type Glib::RefPtr<Gtk::ListStore> combo_list = Glib::RefPtr<Gtk::ListStore>::cast_static(VRGuiBuilder()->get_object("socket_type_list")); gchar *t; gtk_tree_model_get((GtkTreeModel*)combo_list->gobj(), new_iter, 0, &t, -1); string type = string(t); Gtk::TreeModel::Row row = *iter; VRGuiNet_SocketCols cols; row[cols.type] = type; VRSocket* socket = (VRSocket*)row.get_value(cols.obj); socket->setType(type); row[cols.sens] = socket->isClient(); }
void TreeViewValue::on_row_activated(const Gtk::TreeModel::Path& path, Gtk::TreeViewColumn* /*column*/) { Gtk::TreeModel::iterator iter = m_refTreeModel->get_iter(path); if (iter) { Gtk::TreeModel::Row row = *iter; value::Value* v = &*row.get_value(m_Columns.m_col_value); if (row[m_Columns.m_col_type] == _("map")) { value::Map* map = dynamic_cast<value::Map*>(v); ValueBox box(map); box.run(); } else if (row[m_Columns.m_col_type] == _("set")) { value::Set* set = dynamic_cast<value::Set*>(v); ValueBox box(set); box.run(); } else if (row[m_Columns.m_col_type] == _("boolean")) { value::Boolean* boolean = dynamic_cast<value::Boolean*>(v); BooleanBox box(boolean); box.run(); } else if (row[m_Columns.m_col_type] == _("integer") or row[m_Columns.m_col_type] == _("double") or row[m_Columns.m_col_type] == _("string") or row[m_Columns.m_col_type] == _("tuple")) { SimpleTypeBox box(v); box.run(); } else if (row[m_Columns.m_col_type] == _("table")) { value::Table* table = dynamic_cast<value::Table*>(v); TableBox box(table); box.run(); } else if (row[m_Columns.m_col_type] == _("matrix")) { value::Matrix* matrix = dynamic_cast<value::Matrix*>(v); MatrixBox box(matrix); box.run(); } else if (row[m_Columns.m_col_type] == _("xml")) { value::Xml* xml = dynamic_cast<value::Xml*>(v); XmlTypeBox box(xml); box.run(); } value::Value* val = &*row.get_value(m_Columns.m_col_value); row[m_Columns.m_col_view] = boost::trim_copy(val->writeToString()).substr(0, GVLE::overview_max); refresh(); } }
void RFO::update_model() { // re-build the model each time for ease ... m_model->clear(); size_t psep; std::string root_label = m_filename; if (!root_label.length()) root_label = _("Unsaved file"); else if ((psep = m_filename.find_last_of("/\\")) != string::npos) root_label = m_filename.substr(psep + 1); Gtk::TreeModel::iterator root; root = m_model->append(); Gtk::TreeModel::Row row = *root; row[m_cols->m_name] = root_label; row[m_cols->m_object] = -1; row[m_cols->m_file] = -1; row[m_cols->m_pickindex] = 0; gint index = 1; // pick/select index. matches computation in draw() for (guint i = 0; i < Objects.size(); i++) { Objects[i].idx = i; Gtk::TreeModel::iterator obj = m_model->append(row.children()); Gtk::TreeModel::Row orow = *obj; orow[m_cols->m_name] = Objects[i].name; orow[m_cols->m_object] = i; orow[m_cols->m_file] = -1; orow[m_cols->m_pickindex] = index++; for (guint j = 0; j < Objects[i].files.size(); j++) { Objects[i].files[j].idx = j; Gtk::TreeModel::iterator iter = m_model->append(orow.children()); row = *iter; row[m_cols->m_name] = Objects[i].files[j].location; row[m_cols->m_object] = i; row[m_cols->m_file] = j; row[m_cols->m_pickindex] = index++; } } }
void VRGuiNet_on_del_clicked(GtkButton*, gpointer data) { Glib::RefPtr<Gtk::TreeView> tree_view = Glib::RefPtr<Gtk::TreeView>::cast_static(VRGuiBuilder()->get_object("treeview9")); Gtk::TreeModel::iterator iter = tree_view->get_selection()->get_selected(); if(!iter) return; VRGuiNet_SocketCols cols; Gtk::TreeModel::Row row = *iter; string name = row.get_value(cols.name); string msg1 = "Delete socket " + name; if (!askUser(msg1, "Are you sure you want to delete this socket?")) return; VRSceneManager::getCurrent()->remSocket(name); Glib::RefPtr<Gtk::ListStore> list_store = Glib::RefPtr<Gtk::ListStore>::cast_static(VRGuiBuilder()->get_object("Sockets")); list_store->erase(iter); Gtk::ToolButton* b; VRGuiBuilder()->get_widget("toolbutton15", b); b->set_sensitive(false); }
void TreeViewValue::on_menu_duplicate() { Glib::RefPtr<Gtk::TreeView::Selection> refSelection = get_selection(); if (refSelection) { Gtk::TreeModel::iterator iter = refSelection->get_selected(); if (iter) { Gtk::TreeModel::Row row = *iter; value::Value* base = &*row.get_value(m_Columns.m_col_value); if (mValue->getType() == value::Value::SET) { value::Set& set = mValue->toSet(); value::VectorValue& vector = set.value(); value::VectorValue::iterator it = vector.end(); vector.insert(it, base->clone()); refresh(); } else if (mValue->getType() == value::Value::MAP) { value::Map& mp = mValue->toMap(); value::MapValue& map = mp.value(); std::string name = "" + row[m_Columns.m_col_name]; int number = 1; std::string copy; value::MapValue::iterator it; do { copy = name + "_" + boost::lexical_cast< std::string >(number); ++number; it = map.find(copy); } while (it != map.end()); map[copy] = base->clone(); refresh(); } } } }
void ArbitratorPropertyWindow::update(Glib::RefPtr<PortArbitratorModel> &arbPort) { m_arbPort = arbPort; Arbitrator& arbitrator = m_arbPort->getArbitrator(); m_refTreeModel->clear(); Gtk::TreeModel::Row row; Gtk::TreeModel::Row childrow; row = *(m_refTreeModel->append()); row[m_Columns.m_col_name] = "Port"; row[m_Columns.m_col_value] = arbitrator.getPort(); row[m_Columns.m_col_color_value] = Gdk::Color("#888888"); row[m_Columns.m_col_editable] = false; row = *(m_refTreeModel->append()); rulesRow = row; row[m_Columns.m_col_name] = "Rules"; row[m_Columns.m_col_color_value] = Gdk::Color("#888888"); row[m_Columns.m_col_editable] = false; std::map<string, string> &rules = arbitrator.getRuleMap(); std::map<string, string>::iterator itr; for(itr=rules.begin(); itr!=rules.end(); itr++) { childrow = *(m_refTreeModel->append(row.children())); childrow[m_Columns.m_col_name] = (itr->first).c_str(); childrow[m_Columns.m_col_value] = (itr->second).c_str(); childrow[m_Columns.m_col_editable] = true; if(!arbitrator.trainWeights((itr->first).c_str())) childrow[m_Columns.m_col_color_value] = Gdk::Color("#FF0000"); else childrow[m_Columns.m_col_color_value] = Gdk::Color("#000000"); } m_arbPort->setErrorMode(!arbitrator.validate()); m_TreeView.expand_all(); m_pParent->reportErrors(); }
// // Gtk::TreeModel::Children からノードツリーを生成 // // ただし列は SKELETON::EditColumns を継承したものであること // void Dom::parse( const Gtk::TreeModel::Children& children, SKELETON::EditColumns& columns ) { if( ! this || children.empty() ) return; // Gtk::TreeModel::Children を走査 Gtk::TreeModel::iterator it = children.begin(); while( it != children.end() ) { Gtk::TreeModel::Row row = *it; // 各値を取得( skeleton/editcolumns.h を参照 ) const int type = row[ columns.m_type ]; const Glib::ustring url = row[ columns.m_url ]; const Glib::ustring data = row[ columns.m_data ]; const Glib::ustring name = row[ columns.m_name ]; const size_t dirid = row[ columns.m_dirid ]; const bool expand = row[ columns.m_expand ]; if( type != TYPE_UNKNOWN ) { // タイプにより要素名を決定( board や link など) const std::string node_name = XML::get_name( type ); if( ! node_name.empty() ) { Dom* node = appendChild( NODE_TYPE_ELEMENT, node_name ); if( type == TYPE_DIR && expand ) node->setAttribute( "open", "y" ); if( ! name.empty() ) node->setAttribute( "name", name ); if( ! url.empty() ) node->setAttribute( "url", url ); if( ! data.empty() ) node->setAttribute( "data", data ); if( dirid ) node->setAttribute( "dirid", dirid ); // 再帰 if( ! row.children().empty() ) node->parse( row.children(), columns ); } } ++it; } }
void TreeViewValue::on_menu_remove() { Glib::RefPtr<Gtk::TreeView::Selection> refSelection = get_selection(); if (refSelection) { Gtk::TreeModel::iterator iter = refSelection->get_selected(); if (iter) { Gtk::TreeModel::Row row = *iter; value::Value* base = &*row.get_value(m_Columns.m_col_value); if (mValue->getType() == value::Value::SET) { value::Set* set = dynamic_cast<value::Set*>(mValue); value::VectorValue& vector = set->value(); value::VectorValue::iterator it = vector.begin(); while (it != vector.end()) { if (&**it == base) break; ++it; } if (it != vector.end()) { vector.erase(it); refresh(); } } else if (mValue->getType() == value::Value::MAP) { value::Map* m = dynamic_cast<value::Map*>(mValue); value::MapValue& map = m->value(); std::string name = "" + row[m_Columns.m_col_name]; value::MapValue::iterator it = map.find(name); if (it != map.end()) { map.erase(it); refresh(); } } } } }
bool ApplicationList::addApplication(Application* app) { typedef Gtk::TreeModel::Children type_children; type_children children = m_refTreeModel->children(); for(type_children::iterator iter = children.begin(); iter != children.end(); ++iter) { Gtk::TreeModel::Row row = *iter; if(row[m_appColumns.m_col_name] == Glib::ustring("Applications")) { type_children appchild = row->children(); for(type_children::iterator itrapp = appchild.begin(); itrapp!= appchild.end(); ++itrapp) { Gtk::TreeModel::Row childrow = *itrapp; if(childrow[m_appColumns.m_col_name] == Glib::ustring(app->getName())) return false; } } } Gtk::TreeModel::Row childrow = *(m_refTreeModel->append(m_appRow.children())); childrow[m_appColumns.m_col_type] = APPLICATION; childrow[m_appColumns.m_col_name] = app->getName(); childrow[m_appColumns.m_col_filename] = app->getXmlFile(); childrow.set_value(0, Gdk::Pixbuf::create_from_data(application_ico.pixel_data, Gdk::COLORSPACE_RGB, true, 8, application_ico.width, application_ico.height, application_ico.bytes_per_pixel*application_ico.width)); string fname; string fpath = app->getXmlFile(); size_t pos = fpath.rfind(PATH_SEPERATOR); if(pos!=string::npos) fname = fpath.substr(pos+1); else fname = fpath; fname = fname + string(" (") + fpath + string(")"); Gtk::TreeModel::Row descrow = *(m_refTreeModel->append(childrow.children())); descrow[m_appColumns.m_col_type] = NODE_FILENAME; descrow[m_appColumns.m_col_name] = fname; descrow[m_appColumns.m_col_filename] = app->getXmlFile(); descrow.set_value(0, Gdk::Pixbuf::create_from_data(document_ico.pixel_data, Gdk::COLORSPACE_RGB, true, 8, document_ico.width, document_ico.height, document_ico.bytes_per_pixel*document_ico.width)); return true; }
void ProductoBox::modificarProducto(std::vector<std::string> imagenes){ Glib::RefPtr<Gtk::Builder> builder = Gtk::Builder::create(); builder -> add_from_file("glade/dialogoAgregarProducto.glade"); DialogoAgregarProducto* dialogo; builder -> get_widget_derived("dialogoAgregarProducto", dialogo); Gtk::TreeModel::iterator iter = selection -> get_selected(); if(!iter)return; Gtk::TreeModel::Row row = *iter; std::string producto = row.get_value(nombre); std::string descripcionS = row.get_value(descripcion); std::string iconoS = row.get_value(icono); std::string idS = row.get_value(id); dialogo->precargarCampos(producto, descripcionS,iconoS,imagenes); int result = dialogo->run(); if(result == Gtk::RESPONSE_CANCEL)return; dialogo -> close(); std::vector<std::string> nuevasImagenes = dialogo->obtenerImagenes(); std::string nuevoNombre = dialogo->obtenerNombreProducto(); std::string nuevaDescripcion = dialogo->obtenerDescripcionProducto(); std::string nuevoIcono = dialogo -> obtenerIcono(); sig_modificarProducto.emit(idS,nuevoNombre,nuevaDescripcion,nuevoIcono,nuevasImagenes); }
void PredicateDialog::onDeletePredicate() { Glib::RefPtr < Gtk::TreeView::Selection > ref = mTreePredicateList-> get_selection(); if (ref) { Gtk::TreeModel::iterator iter = ref->get_selected(); if (iter) { if (Question(_("Are you sure you want to delete this predicate?"))) { mPredicateNameEntry->set_text(""); mTextViewFunction->get_buffer()->set_text(""); mHeaderPred->set_text(""); Gtk::TreeModel::Row row = *iter; std::string name(row.get_value(m_viewscolumnrecord.name)); m_model->erase(iter); Gtk::TreeModel::Children children = m_model->children(); m_iter = children.begin(); // Delete the element in the vector for (std::vector < std::string > ::iterator it = mPredicateName.begin(); it != mPredicateName.end(); ) { if ( *it == name ) { it = mPredicateName.erase(it); } else { ++it; } } if (mPredicateFunction.find(name) != mPredicateFunction.end()) { mPredicateFunction.erase(name); } setSensitivePredicate(false); } } } }
void VRGuiBits_on_viewoption_changed(GtkComboBox* cb, gpointer data) { int i = gtk_combo_box_get_active(cb); if (i == -1) return; // get all in VRScene* scene = VRSceneManager::get()->getActiveScene(); VRSetup* setup = VRSetupManager::get()->getCurrent(); Glib::RefPtr<Gtk::ListStore> opt_list = Glib::RefPtr<Gtk::ListStore>::cast_static(VRGuiBuilder()->get_object("view_options")); VRGuiSetup_ViewOptsColumns cols; Gtk::TreeModel::Row row = *getComboboxIter("combobox20"); string opt = row.get_value(cols.option); bool b = row.get_value(cols.state); b = !b; // process option if (opt == "referentials") scene->showReferentials(b); if (opt == "setup") setup->showSetup(b); if (opt == "lights and cameras") scene->showLightsCameras(b); // update liststore toggle gtk_list_store_set (opt_list->gobj(), row.gobj(), 1, (int)b, -1); setCombobox("combobox20", -1); }
void ObsAndViewBox::makeObs() { mRefTreeObs->clear(); const vpz::ObservablePortList& port_list = mObs->observableportlist(); vpz::ObservablePortList::const_iterator it_port = port_list.begin(); while (it_port != port_list.end()) { Gtk::TreeModel::Row row = *(mRefTreeObs->append()); row[mColumnsObs.m_col_name] = it_port->first; row[mColumnsObs.m_col_type] = it_port->second.getType(); const vpz::ViewNameList& view_list = it_port->second.viewnamelist(); vpz::ViewNameList::const_iterator it_view = view_list.begin(); while (it_view != view_list.end()) { Gtk::TreeModel::Row childrow = *(mRefTreeObs->append(row.children())); childrow[mColumnsObs.m_col_name] = *it_view; childrow[mColumnsObs.m_col_type] = vpz::Base::VLE_VPZ_VIEW; ++it_view; } ++it_port; } mTreeViewObs->expand_all(); }
void InheritanceWindow::descendTypeTree(Eris::TypeInfo * node, Gtk::TreeModel::Row & row) { assert(node != NULL); std::cout << "Node " << node->getName() << std::endl << std::flush; row[*m_nameColumn] = node->getName(); const Eris::TypeInfoSet & children = node->getChildren(); Eris::TypeInfoSet::const_iterator I = children.begin(); for (; I != children.end(); I++) { Gtk::TreeModel::Row childrow = *(m_treeModel->append(row.children())); descendTypeTree(*I, childrow); } }
void Cal3dOptions::insertType(Eris::TypeInfo * const ti, Gtk::TreeModel::Row row) { assert(ti != 0); row[*m_nameColumn] = Glib::ustring(ti->getName()); row[*m_ptrColumn] = ti; const Eris::TypeInfoSet & children = ti->getChildren(); Eris::TypeInfoSet::const_iterator I = children.begin(); Eris::TypeInfoSet::const_iterator Iend = children.end(); for (; I != Iend; ++I) { Gtk::TreeModel::Row childrow = *(m_treeModel->append(row.children())); insertType(*I, childrow); } }