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);
   }

}
Beispiel #2
0
Gtk::VPaned *SendMsgDlgTab::setup_im_pane()
{
	Gtk::VPaned *paned;
	paned = Gtk::manage(new Gtk::VPaned);
	Gtk::VBox *vbox;
	vbox = Gtk::manage(new Gtk::VBox(false, 5));
	paned->pack1(*vbox, true, true);
	
	Gtk::ScrolledWindow *sw;
	sw = Gtk::manage(new Gtk::ScrolledWindow());
	sw->set_policy(Gtk::POLICY_NEVER, Gtk::POLICY_ALWAYS);
	sw->set_shadow_type(Gtk::SHADOW_IN);
	vbox->pack_start(*sw, true, true, 0);
	sw->set_size_request(230, 150);
	
	imhtml = gtk_imhtml_new(NULL, NULL);
	gtk_container_add(GTK_CONTAINER(sw->gobj()), imhtml);
	gtk_imhtml_show_comments(GTK_IMHTML(imhtml), true);
	
	Gtk::VBox *vbox2;
	vbox2 = Gtk::manage(new Gtk::VBox(false, 5));
	paned->pack2(*vbox2, false, false);
	
	Gtk::VBox *tool_vbox;
	tool_vbox = build_conv_toolbutton_vbox();
	
	vbox2->pack_start(*tool_vbox, false, false, 0);
	
	Gtk::Frame *frame;
	frame = Gtk::manage(new Gtk::Frame());
	frame->set_shadow_type(Gtk::SHADOW_IN);
	vbox2->pack_start(*frame, true, true, 0);
	
	m_input_textview.set_wrap_mode(Gtk::WRAP_WORD);
	m_input_textview.set_size_request(-1, 45);
	frame->add(m_input_textview);
	//m_input_textview.grab_focus();
	m_input_textview.signal_event().connect(SigC::slot(*this, &SendMsgDlgTab::on_input_textview_event));

	Gtk::HBox *hbox;
	hbox = Gtk::manage(new Gtk::HBox(false, 5));
	vbox2->pack_start(*hbox, false, false, 0);
	setup_im_buttons(hbox);
	
	return paned;
}
MESignPostInfoDialog::MESignPostInfoDialog(
      OldConnection* conn, uint32 toNodeID, MEMapArea* mapArea)
{

   m_connection = conn;
   m_toNodeID = toNodeID;
   m_mapArea = mapArea;
   m_editSpDialog = NULL;

   char tmpStr[256];
   sprintf( tmpStr, "%s, 0x%x",
            "Sign post info", m_mapArea->getMap()->getMapID() );
   set_title(tmpStr);
   
   // list with all sign posts for this connection
   Gtk::Frame* frame = manage(new Gtk::Frame("Signposts:"));

   // Create ListStore and add to TreeView
   m_listStore = Gtk::ListStore::create(m_columns);
   m_treeView.set_model(m_listStore);

   // Add visible columns to TreeView
   m_treeView.append_column("REMOVE ME", m_columns.m_info);
   m_treeView.set_headers_visible(false);

   // Create selection object to handle selections
   m_selection = m_treeView.get_selection();
   if(!m_selection)
   { 
      // If this doesn't work we're in trouble.
      mc2log << error << "No selection object created for corresponding "
             << "TreeView" << endl;
      MC2_ASSERT(false);
   }


   Gtk::ScrolledWindow* scrolledWin = manage(new Gtk::ScrolledWindow());
   scrolledWin->set_size_request(200, 150);
   scrolledWin->set_policy(Gtk::POLICY_AUTOMATIC, Gtk::POLICY_AUTOMATIC);
   scrolledWin->add(m_treeView);
   frame->add(*scrolledWin);
   get_vbox()->pack_start(*frame, true, true, 5);

   // buttons for Edit and Close in the action area
   Gtk::HBox* actionBox = manage(new Gtk::HBox());
   if (m_mapArea != NULL) {
      Gtk::Button* editButton = manage(new Gtk::Button("Edit"));
      editButton->set_size_request(75, 25);
      editButton->signal_clicked().connect(
            sigc::mem_fun(*this, &MESignPostInfoDialog::editSpPressed));
      actionBox->pack_start(*editButton);
   } else {
      // empty label..
      Gtk::Label* editLabel = manage(new Gtk::Label(""));
      editLabel->set_size_request(75, 25);
      actionBox->pack_start(*editLabel);
   }
   Gtk::Button* closeButton = manage(new Gtk::Button("Close"));
   closeButton->signal_clicked().connect(
                  sigc::mem_fun(*this, &MESignPostInfoDialog::closePressed));
   closeButton->set_size_request(75, 25);
   actionBox->pack_start(*closeButton);
   get_action_area()->pack_start(*actionBox);

   // Don't show the dialog now, wait for show()-command.
}