//------------------------------------------------------------------------------ void DbMySQLTableEditorIndexPage::switch_be(MySQLTableEditorBE *be) { if (!_editing_sig.empty()) _editing_sig.disconnect(); _index_node = bec::NodeId(); _indexes_columns_model.clear(); Gtk::TreeView *tv = 0; _xml->get_widget("index_columns", tv); tv->remove_all_columns(); tv->unset_model(); _be = be; _be->get_indexes()->select_index(_index_node); // refresh is done from TableEd _indexes_tv->remove_all_columns(); _indexes_model = ListModelWrapper::create(_be->get_indexes(), _indexes_tv, "DbMySQLTableEditorIndexPage"); _indexes_model->model().append_string_column(0, "Index Name", EDITABLE, NO_ICON); _indexes_model->model().append_combo_column(1, "Type", model_from_string_list(_be->get_index_types()), EDITABLE, true); _indexes_tv->set_model(_indexes_model); Gtk::CellRenderer *rend = _indexes_tv->get_column_cell_renderer(0); _editing_sig = rend->signal_editing_started().connect(sigc::mem_fun(this, &DbMySQLTableEditorIndexPage::cell_editing_started)); }
void PseudoAxesFrame::update(void) { Gtk::CellRenderer *renderer; this->updatePseudoAxis(); renderer = _treeview1->get_column_cell_renderer(1); // 1 is the index of the value column renderer->property_cell_background().set_value("white"); }
void LiningAdjustmentDialog::init_ui() { builder_->get_widget( "combobox-chip", combobox_chip_); builder_->get_widget( "spinbutton-strip", spinbutton_strip_); builder_->get_widget( "spinbutton-code", spinbutton_code_); builder_->get_widget( "spinbutton-broadcast", spinbutton_broadcast_); builder_->get_widget( "toolbutton-load-from-file", menutoolbutton_load_from_file_); builder_->get_widget( "menuitem-restore-current", menuitem_restore_current_); builder_->get_widget( "menuitem-restore-all", menuitem_restore_all_); builder_->get_widget( "toolbutton-write-current", menutoolbutton_write_current_); builder_->get_widget( "menuitem-write-all", menuitem_write_all_); Glib::RefPtr<Glib::Object> obj; obj = builder_->get_object("liststore-strip-code"); liststore_strip_code_ = Glib::RefPtr<Gtk::ListStore>::cast_dynamic(obj); // create items StripCodeVector codes; for ( int i = 0; i < SCANNER_STRIPS_PER_CHIP_REAL; ++i) { codes.push_back(StripCode( i + 1, 0)); } // add rows for ( StripCodeVector::const_iterator it = codes.begin(); it != codes.end(); ++ it) { Gtk::TreeRow row = *(liststore_strip_code_->append()); row[model_columns.strip] = it->first; row[model_columns.code] = it->second; } builder_->get_widget( "treeview-strip-code", treeview_strip_code_); selection_strip_code_ = treeview_strip_code_->get_selection(); selection_strip_code_->set_mode(Gtk::SELECTION_SINGLE); // add columns Gtk::TreeViewColumn* column; Gtk::CellRenderer* renderer; column = new Gtk::TreeView::Column( _("Strip"), model_columns.strip); column->set_alignment(Gtk::ALIGN_CENTER); renderer = column->get_first_cell_renderer(); renderer->property_xalign() = 1.; treeview_strip_code_->append_column(*Gtk::manage(column)); column = new Gtk::TreeView::Column( _("Code"), model_columns.code); column->set_alignment(Gtk::ALIGN_CENTER); renderer = column->get_first_cell_renderer(); renderer->property_xalign() = .5; treeview_strip_code_->append_column(*Gtk::manage(column)); }
void playlistWindow::configureTreeview(void) { // create the data model playlistStore = Gtk::ListStore::create(playlistColumns); // set the data model playlistTreeview->set_model(playlistStore); //Add the TreeView's view columns playlistTreeview->append_column("", playlistColumns.playlistidcol); playlistTreeview->append_column("Name", playlistColumns.playlistnamecol); playlistTreeview->append_column("Length", playlistColumns.playlistlengthcol); playlistTreeview->append_column("Format", playlistColumns.playlistformatcol); playlistTreeview->append_column("Date of creation", playlistColumns.playlistdateofcreationcol); playlistTreeview->append_column("Cell background color", playlistColumns.playlistcellbgcolorcol); Gtk::TreeView::Column* pColumn; for(guint i = 1; i < 5; i++) { pColumn = playlistTreeview->get_column(i); Gtk::CellRenderer* cellRenderer = playlistTreeview->get_column_cell_renderer(i); pColumn->add_attribute(cellRenderer->property_cell_background(), playlistColumns.playlistcellbgcolorcol); pColumn->set_reorderable(); switch(i) { case 1 : pColumn->set_sort_column(playlistColumns.playlistnamecol); break; case 2 : pColumn->set_sort_column(playlistColumns.playlistlengthcol); break; case 3 : pColumn->set_sort_column(playlistColumns.playlistformatcol); break; case 4 : pColumn->set_sort_column(playlistColumns.playlistdateofcreationcol); break; } } pColumn = playlistTreeview->get_column(5); pColumn->set_visible(false); //All the items to be reordered with drag-and-drop // Set the visibility state of the headers. playlistTreeview->set_headers_visible(true); // Allow the column title buttons to be clicked playlistTreeview->set_headers_clickable(true); // Resize all columns to their optimal width. playlistTreeview->columns_autosize(); // all element are reordorable playlistTreeview->set_reorderable(); playlistTreeview->set_rules_hint(); // grab the treeview selection playlistTreeviewSelection = playlistTreeview->get_selection(); // connect signal to dectect when tree selection change playlistTreeview->signal_button_press_event().connect(sigc::mem_fun(*this, &playlistWindow::on_playlist_selection_changed),false); initPlaylistStates(); }
//------------------------------------------------------------------------------ void DbMySQLTableEditorFKPage::switch_be(MySQLTableEditorBE* be) { _fk_columns_model.clear(); _fk_columns_tv->unset_model(); _fk_columns_tv->remove_all_columns(); _be = be; _fk_tv->remove_all_columns(); _fk_model = ListModelWrapper::create(_be->get_fks(), _fk_tv, "DbMySQLTableEditorFKPage"); _fk_tables_model = model_from_string_list(_be->get_all_table_names()); _fk_model->model().append_string_column(bec::FKConstraintListBE::Name, "Foreign Key Name", EDITABLE, NO_ICON); _fk_model->model().append_combo_column(bec::FKConstraintListBE::RefTable, "Referenced Table", _fk_tables_model, EDITABLE, true); _fk_tv->set_model(_fk_model); Gtk::CellRenderer* rend = _fk_tv->get_column_cell_renderer(0); g_signal_connect(rend->gobj(), "editing-started", GCallback(&DbMySQLTableEditorFKPage::cell_editing_started), this); }
bool DbMySQLTableEditorIndexPage::real_refresh() { if (!_editing_sig.empty()) _editing_sig.disconnect(); Gtk::TreeView *tv = 0; _xml->get_widget("index_columns", tv); tv->unset_model(); tv->remove_all_columns(); _index_node = bec::NodeId(); _be->get_indexes()->select_index(_index_node); fill_combo_from_string_list(_index_storage_combo, _be->get_index_storage_types()); _indexes_tv->remove_all_columns(); _indexes_model = ListModelWrapper::create(_be->get_indexes(), _indexes_tv, "DbMySQLTableEditorIndexPage"); _indexes_model->model().append_string_column(0, "Index Name", EDITABLE, NO_ICON); _indexes_model->model().append_combo_column(1, "Type", model_from_string_list(_be->get_index_types()), EDITABLE, true); _indexes_tv->set_model(_indexes_model); Gtk::CellRenderer* rend = _indexes_tv->get_column_cell_renderer(0); _editing_sig = rend->signal_editing_started(). connect(sigc::mem_fun(this, &DbMySQLTableEditorIndexPage::cell_editing_started)); const bool has_columns = _be->get_columns()->count() > 1; tv->set_sensitive(has_columns); _indexes_tv->set_sensitive(has_columns); index_cursor_changed(); return false; }
void PseudoAxesFrame::on_cell_TreeView_pseudoAxis_value_edited(Glib::ustring const & spath, Glib::ustring const & newText) { double value; HklPseudoAxis *pseudo; Gtk::TreePath path(spath); Gtk::TreeModel::iterator iter = _pseudoAxis_ListStore->get_iter(path); Gtk::ListStore::Row row = *(iter); sscanf(newText.c_str(), "%lf", &value); pseudo = row[_pseudoAxis_columns.pseudo]; if(pseudo){ Gtk::CellRenderer *renderer; renderer = _treeview1->get_column_cell_renderer(1); // 1 is the index of the value column renderer->property_cell_background().set_value("red"); hkl_parameter_set_value_unit((HklParameter *)pseudo, value); row[_pseudoAxis_columns.value] = value; } }
GrubSettingsDlgGtk::GrubSettingsDlgGtk() : event_lock(false), bttRemoveCustomEntry(Gtk::Stock::REMOVE), rbDefPredefined(gettext("pre_defined: "), true), rbDefSaved(gettext("previously _booted entry"), true), lblDefaultEntry(gettext("default entry")), lblView(gettext("visibility")), chkShowMenu(gettext("show menu")), lblTimeout(gettext("Timeout")), lblTimeout2(gettext("Seconds")), lblKernelParams(gettext("kernel parameters")), chkGenerateRecovery(gettext("generate recovery entries")), chkOsProber(gettext("look for other operating systems")), chkResolution(gettext("custom resolution: ")), gccNormalBackground(true), gccHighlightBackground(true) { this->set_title("GPC - "+Glib::ustring(gettext("settings"))); this->set_icon_name("gpc"); Gtk::VBox* winBox = this->get_vbox(); winBox->add(tabbox); tabbox.append_page(alignCommonSettings, gettext("_General"), true); tabbox.append_page(vbAppearanceSettings, gettext("A_ppearance"), true); tabbox.append_page(vbAllEntries, gettext("_Advanced"), true); vbAllEntries.pack_start(hbAllEntriesControl, Gtk::PACK_SHRINK); vbAllEntries.pack_start(scrAllEntries); hbAllEntriesControl.add(bttAddCustomEntry); hbAllEntriesControl.add(bttRemoveCustomEntry); hbAllEntriesControl.set_border_width(5); hbAllEntriesControl.set_spacing(5); scrAllEntries.add(tvAllEntries); scrAllEntries.set_border_width(5); scrAllEntries.set_policy(Gtk::POLICY_AUTOMATIC, Gtk::POLICY_AUTOMATIC); refAsListStore = Gtk::ListStore::create(asTreeModel); tvAllEntries.set_model(refAsListStore); tvAllEntries.append_column_editable(gettext("is active"), asTreeModel.active); tvAllEntries.append_column_editable(gettext("name"), asTreeModel.name); tvAllEntries.append_column_editable(gettext("value"), asTreeModel.value); refAsListStore->signal_row_changed().connect(sigc::mem_fun(this, &GrubSettingsDlgGtk::signal_setting_row_changed)); vbCommonSettings.set_spacing(15); vbAppearanceSettings.set_spacing(15); vbCommonSettings.pack_start(groupDefaultEntry, Gtk::PACK_SHRINK); groupDefaultEntry.add(alignDefaultEntry); groupDefaultEntry.set_sensitive(false); groupDefaultEntry.set_label_widget(lblDefaultEntry); lblDefaultEntry.set_attributes(attrDefaultEntry); aDefaultEntry = Pango::Attribute::create_attr_weight(Pango::WEIGHT_BOLD); attrDefaultEntry.insert(aDefaultEntry); alignDefaultEntry.add(vbDefaultEntry); vbDefaultEntry.add(hbDefPredefined); vbDefaultEntry.add(rbDefSaved); hbDefPredefined.pack_start(rbDefPredefined, Gtk::PACK_SHRINK); hbDefPredefined.pack_start(cbDefEntry); vbDefaultEntry.set_spacing(5); groupDefaultEntry.set_shadow_type(Gtk::SHADOW_NONE); alignDefaultEntry.set_padding(2, 2, 25, 2); rbDefPredefined.set_group(rbgDefEntry); rbDefSaved.set_group(rbgDefEntry); Glib::ListHandle<Gtk::CellRenderer*> cellRenderers = cbDefEntry.get_cells(); Gtk::CellRenderer* cellRenderer = *cellRenderers.begin(); cellRenderer->set_fixed_size(200, -1); cbDefEntry.set_wrap_width(2); alignCommonSettings.add(vbCommonSettings); alignCommonSettings.set_padding(20, 0, 0, 0); vbCommonSettings.pack_start(groupView, Gtk::PACK_SHRINK); groupView.add(alignView); groupView.set_shadow_type(Gtk::SHADOW_NONE); groupView.set_label_widget(lblView); lblView.set_attributes(attrDefaultEntry); alignView.add(vbView); vbView.set_spacing(5); alignView.set_padding(2, 2, 25, 2); vbView.add(chkShowMenu); vbView.add(chkOsProber); vbView.add(hbTimeout); hbTimeout.set_spacing(5); hbTimeout.pack_start(lblTimeout, Gtk::PACK_SHRINK); hbTimeout.pack_start(spTimeout, Gtk::PACK_SHRINK); hbTimeout.pack_start(lblTimeout2, Gtk::PACK_SHRINK); spTimeout.set_digits(0); spTimeout.set_increments(1, 5); spTimeout.set_range(0, 1000000); vbCommonSettings.pack_start(groupKernelParams, Gtk::PACK_SHRINK); groupKernelParams.add(alignKernelParams); groupKernelParams.set_shadow_type(Gtk::SHADOW_NONE); groupKernelParams.set_label_widget(lblKernelParams); lblKernelParams.set_attributes(attrDefaultEntry); alignKernelParams.add(vbKernelParams); alignKernelParams.set_padding(10, 2, 25, 2); vbKernelParams.add(txtKernelParams); vbKernelParams.add(chkGenerateRecovery); vbKernelParams.set_spacing(5); vbAppearanceSettings.pack_start(alignResolution, Gtk::PACK_SHRINK); alignResolution.add(hbResolution); alignResolution.set_padding(10, 0, 6, 0); hbResolution.pack_start(chkResolution, Gtk::PACK_SHRINK); hbResolution.pack_start(cbResolution); cbResolution.append_text("saved"); //color chooser vbAppearanceSettings.pack_start(groupColorChooser, Gtk::PACK_SHRINK); groupColorChooser.set_label_widget(lblColorChooser); groupColorChooser.set_shadow_type(Gtk::SHADOW_NONE); lblColorChooser.set_attributes(attrDefaultEntry); alignColorChooser.add(tblColorChooser); tblColorChooser.attach(lblforegroundColor, 1,2,0,1); tblColorChooser.attach(lblBackgroundColor, 2,3,0,1); tblColorChooser.attach(lblNormalColor, 0,1,1,2); tblColorChooser.attach(lblHighlightColor, 0,1,2,3); tblColorChooser.attach(gccNormalForeground, 1,2,1,2); tblColorChooser.attach(gccNormalBackground, 2,3,1,2); tblColorChooser.attach(gccHighlightForeground, 1,2,2,3); tblColorChooser.attach(gccHighlightBackground, 2,3,2,3); tblColorChooser.set_spacings(10); //background image vbAppearanceSettings.pack_start(groupBackgroundImage); groupBackgroundImage.set_shadow_type(Gtk::SHADOW_NONE); groupBackgroundImage.add(alignBackgroundImage); groupBackgroundImage.set_label_widget(lblBackgroundImage); lblBackgroundImage.set_attributes(attrDefaultEntry); alignBackgroundImage.add(vbBackgroundImage); vbBackgroundImage.pack_start(hbImgBtts); vbBackgroundImage.pack_start(lblBackgroundRequiredInfo); vbButtons.add(bttRemoveBackground); vbBackgroundImage.set_spacing(5); hbImgBtts.set_spacing(5); vbButtons.set_spacing(5); bttRemoveBackground.set_no_show_all(true); imgBackgroundImage.set_no_show_all(true); lblBackgroundRequiredInfo.set_no_show_all(true); //<signals> rbDefPredefined.signal_toggled().connect(sigc::mem_fun(this, &GrubSettingsDlgGtk::signal_default_entry_predefined_toggeled)); rbDefSaved.signal_toggled().connect(sigc::mem_fun(this, &GrubSettingsDlgGtk::signal_default_entry_saved_toggeled)); cbDefEntry.signal_changed().connect(sigc::mem_fun(this, &GrubSettingsDlgGtk::signal_default_entry_changed)); chkShowMenu.signal_toggled().connect(sigc::mem_fun(this, &GrubSettingsDlgGtk::signal_showMenu_toggled)); chkOsProber.signal_toggled().connect(sigc::mem_fun(this, &GrubSettingsDlgGtk::signal_osProber_toggled)); spTimeout.signal_value_changed().connect(sigc::mem_fun(this, &GrubSettingsDlgGtk::signal_timeout_changed)); txtKernelParams.signal_changed().connect(sigc::mem_fun(this, &GrubSettingsDlgGtk::signal_kernelparams_changed)); chkGenerateRecovery.signal_toggled().connect(sigc::mem_fun(this, &GrubSettingsDlgGtk::signal_recovery_toggled)); chkResolution.signal_toggled().connect(sigc::mem_fun(this, &GrubSettingsDlgGtk::signal_chkResolution_toggled)); cbResolution.get_entry()->signal_changed().connect(sigc::mem_fun(this, &GrubSettingsDlgGtk::signal_resolution_selected)); gccNormalForeground.signal_changed().connect(sigc::mem_fun(this, &GrubSettingsDlgGtk::signal_color_changed)); gccNormalBackground.signal_changed().connect(sigc::mem_fun(this, &GrubSettingsDlgGtk::signal_color_changed)); gccHighlightForeground.signal_changed().connect(sigc::mem_fun(this, &GrubSettingsDlgGtk::signal_color_changed)); gccHighlightBackground.signal_changed().connect(sigc::mem_fun(this, &GrubSettingsDlgGtk::signal_color_changed)); fcBackgroundImage.signal_file_set().connect(sigc::mem_fun(this, &GrubSettingsDlgGtk::signal_other_image_chosen)); bttRemoveBackground.signal_clicked().connect(sigc::mem_fun(this, &GrubSettingsDlgGtk::signal_bttRemoveBackground_clicked)); bttAddCustomEntry.signal_clicked().connect(sigc::mem_fun(this, &GrubSettingsDlgGtk::signal_add_row_button_clicked)); bttRemoveCustomEntry.signal_clicked().connect(sigc::mem_fun(this, &GrubSettingsDlgGtk::signal_remove_row_button_clicked)); this->add_button(Gtk::Stock::CLOSE, Gtk::RESPONSE_CLOSE); this->set_default_size(300, 400); }