void FontSubstitution::show(Glib::ustring out, GSList *l) { Gtk::MessageDialog warning(_("\nSome fonts are not available and have been substituted."), false, Gtk::MESSAGE_INFO, Gtk::BUTTONS_OK, true); warning.set_resizable(true); warning.set_title(_("Font substitution")); GtkWidget *dlg = GTK_WIDGET(warning.gobj()); sp_transientize(dlg); Gtk::TextView * textview = new Gtk::TextView(); textview->set_editable(false); textview->set_wrap_mode(Gtk::WRAP_WORD); textview->show(); textview->get_buffer()->set_text(_(out.c_str())); Gtk::ScrolledWindow * scrollwindow = new Gtk::ScrolledWindow(); scrollwindow->add(*textview); scrollwindow->set_policy(Gtk::POLICY_AUTOMATIC, Gtk::POLICY_AUTOMATIC); scrollwindow->set_shadow_type(Gtk::SHADOW_IN); scrollwindow->set_size_request(0, 100); scrollwindow->show(); Gtk::CheckButton *cbSelect = new Gtk::CheckButton(); cbSelect->set_label(_("Select all the affected items")); cbSelect->set_active(true); cbSelect->show(); Gtk::CheckButton *cbWarning = new Gtk::CheckButton(); cbWarning->set_label(_("Don't show this warning again")); cbWarning->show(); #if GTK_CHECK_VERSION(3,0,0) Gtk::Box * box = warning.get_content_area(); #else Gtk::Box * box = warning.get_vbox(); #endif box->set_spacing(2); box->pack_start(*scrollwindow, true, true, 4); box->pack_start(*cbSelect, false, false, 0); box->pack_start(*cbWarning, false, false, 0); warning.run(); if (cbWarning->get_active()) { Inkscape::Preferences *prefs = Inkscape::Preferences::get(); prefs->setInt("/options/font/substitutedlg", 0); } if (cbSelect->get_active()) { SPDesktop *desktop = SP_ACTIVE_DESKTOP; Inkscape::Selection *selection = sp_desktop_selection (desktop); selection->clear(); selection->setList(l); } }
DlgConvertir::DlgConvertir(Gtk::Window &parent, const std::string &nombreDoc, DocumentoCalifa *doc) : DlgConvertir_glade( parent ) { Gtk::CheckButton * chk; std::string nombre = FileMan::replaceExt( nombreDoc, EtqExtCsv ); // Inic this->set_title( NombreApp ); this->set_icon( parent.get_icon() ); ponNombreArchivo( nombre ); // La lista de conversiones listaConversion->append( CnvtCSV ); listaConversion->append( CnvtHTML ); listaConversion->append( CnvtTXT ); listaConversion->set_active( 0 ); // Los separadores de campos listaSepCampos->set_active_text( "," ); listaSepCampos->append( "," ); listaSepCampos->append( ";" ); listaSepCampos->append( "\\b <SPACE>" ); listaSepCampos->append( "\\t <TAB>" ); // Los separadores decimales listaSepDecimal->set_active_text( "," ); listaSepDecimal->append( "." ); listaSepDecimal->append( "," ); // Poner la lista de chks para los campos for(unsigned int i = 0; i < doc->getListaCampos().size(); ++i) { chk = Gtk::manage( new class Gtk::CheckButton( doc->getListaCampos()[ i ]->nombre ) ); cajaListaCampos->pack_start( *chk, Gtk::PACK_SHRINK, 0 ); chk->set_active(); chk->show(); } // Recordar el documento this->doc = doc; }
FileChooserExtra(int init_x, int init_y) { Gtk::Label *lbl; resize = Gtk::manage(new Gtk::CheckButton("Save options (requires re-render)")); resize->set_active(false); pack_start(*resize); resize->signal_toggled().connect(sigc::mem_fun(*this, &FileChooserExtra::do_toggle)); inner = Gtk::manage(new Gtk::HBox()); lbl = Gtk::manage(new Gtk::Label("X resolution", 0.9, 0.5)); inner->pack_start(*lbl); f_x = Gtk::manage(new Util::HandyEntry<int>()); f_x->set_activates_default(true); inner->pack_start(*f_x); lbl = Gtk::manage(new Gtk::Label("Y resolution", 0.9, 0.5)); inner->pack_start(*lbl); f_y = Gtk::manage(new Util::HandyEntry<int>()); f_y->set_activates_default(true); inner->pack_start(*f_y); antialias = Gtk::manage(new Gtk::CheckButton("Antialias")); antialias->set_active(false); inner->pack_start(*antialias); do_hud = Gtk::manage(new Gtk::CheckButton("Render HUD")); do_hud->set_active(false); inner->pack_start(*do_hud); f_x->update(init_x); f_y->update(init_y); pack_start(*inner); show_all(); resize->show(); inner->hide(); }