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); } }
Gtk::Widget *SearchNotesWidget::make_notebooks_pane() { m_notebooksTree = Gtk::manage( new notebooks::NotebooksTreeView(m_manager, notebooks::NotebookManager::obj() .get_notebooks_with_special_items())); m_notebooksTree->get_selection()->set_mode(Gtk::SELECTION_SINGLE); m_notebooksTree->set_headers_visible(true); m_notebooksTree->set_rules_hint(false); Gtk::CellRenderer *renderer; Gtk::TreeViewColumn *column = manage(new Gtk::TreeViewColumn()); column->set_title(_("Notebooks")); column->set_sizing(Gtk::TREE_VIEW_COLUMN_AUTOSIZE); column->set_resizable(false); renderer = manage(new Gtk::CellRendererPixbuf()); column->pack_start(*renderer, false); column->set_cell_data_func(*renderer, sigc::mem_fun(*this, &SearchNotesWidget::notebook_pixbuf_cell_data_func)); Gtk::CellRendererText *text_renderer = manage(new Gtk::CellRendererText()); text_renderer->property_editable() = true; column->pack_start(*text_renderer, true); column->set_cell_data_func(*text_renderer, sigc::mem_fun(*this, &SearchNotesWidget::notebook_text_cell_data_func)); text_renderer->signal_edited().connect(sigc::mem_fun(*this, &SearchNotesWidget::on_notebook_row_edited)); m_notebooksTree->append_column(*column); m_notebooksTree->signal_row_activated() .connect(sigc::mem_fun(*this, &SearchNotesWidget::on_notebook_row_activated)); m_on_notebook_selection_changed_cid = m_notebooksTree->get_selection()->signal_changed() .connect(sigc::mem_fun(*this, &SearchNotesWidget::on_notebook_selection_changed)); m_notebooksTree->signal_button_press_event() .connect(sigc::mem_fun(*this, &SearchNotesWidget::on_notebooks_tree_button_pressed), false); m_notebooksTree->signal_key_press_event() .connect(sigc::mem_fun(*this, &SearchNotesWidget::on_notebooks_key_pressed)); m_notebooksTree->show(); Gtk::ScrolledWindow *sw = new Gtk::ScrolledWindow(); sw->property_hscrollbar_policy() = Gtk::POLICY_AUTOMATIC; sw->property_vscrollbar_policy() = Gtk::POLICY_AUTOMATIC; sw->add(*m_notebooksTree); sw->show(); return sw; }
void listView() { ///Hide/show items for viewing the board list Gtk::ScrolledWindow *boardlist = 0; builder->get_widget("scrolledwindow1", boardlist); boardlist->set_visible(true); boardlist->show(); gtk_widget_destroy(GTK_WIDGET(pWebKitView)); Gtk::Paned *threadview = 0; builder->get_widget("paned1", threadview); threadview->set_visible(false); threadview->hide(); Gtk::ToolItem *boardback = 0; builder->get_widget("toolbutton3", boardback); boardback->set_visible(false); boardback->hide(); Gtk::Label *title = 0; builder->get_widget("label2", title); title->set_text("Boards"); Gtk::ToolItem *refresh1 = 0; builder->get_widget("toolbutton5", refresh1); refresh1->set_visible(false); refresh1->hide(); Gtk::ToolItem *refresh2 = 0; builder->get_widget("toolbutton6", refresh2); refresh2->set_visible(false); refresh2->hide(); Gtk::MenuItem *item3 = 0; builder->get_widget("menuitem3", item3); item3->set_sensitive(false); Gtk::Grid *post_grid; builder->get_widget("grid1", post_grid); post_grid->set_visible(false); post_grid->hide(); Gtk::ToggleToolButton *post_but; builder->get_widget("toolbutton8", post_but); post_but->set_visible(false); post_but->hide(); post_but->set_active(false); }
int NetLogGuiGtkWindow::on_service_added(fawkes::NetworkService *service) { if ( ntb_logviewers.get_n_pages() == 0 ) { lab_no_connection->hide(); //Gtk::Container *thiscon = this; //thiscon->remove(lab_no_connection); //add(ntb_logviewers); ntb_logviewers.show(); } Gtk::HBox *hbox = Gtk::manage(new Gtk::HBox(false, 4)); Gtk::Button *button = Gtk::manage(new Gtk::Button()); Gtk::Image *image = Gtk::manage(new Gtk::Image(Gtk::Stock::CONNECT, Gtk::ICON_SIZE_BUTTON)); button->add(*image); button->set_relief(Gtk::RELIEF_NONE); Gtk::Label *label = Gtk::manage(new Gtk::Label()); label->set_markup(Glib::ustring("<b>") + service->host() + "</b>\n" + service->addr_string()); label->set_line_wrap(); Gtk::Label *invisible = Gtk::manage(new Gtk::Label(Glib::ustring(service->name()) + "::" + service->type() + "::" + service->domain())); Gtk::ScrolledWindow *scrolled = Gtk::manage(new Gtk::ScrolledWindow()); scrolled->set_policy(Gtk::POLICY_AUTOMATIC, Gtk::POLICY_AUTOMATIC); LogView *logview = Gtk::manage(new LogView(service->addr_string().c_str(), service->port())); //scrolled->add(*logview); hbox->pack_start(*button); hbox->pack_start(*label); hbox->pack_start(*invisible); button->signal_clicked().connect(sigc::bind(sigc::mem_fun(*this, &NetLogGuiGtkWindow::on_connbut_clicked), image, logview)); logview->get_connection_dispatcher()->signal_connected().connect(sigc::bind(sigc::mem_fun(*this, &NetLogGuiGtkWindow::on_connected), image)); logview->get_connection_dispatcher()->signal_disconnected().connect(sigc::bind(sigc::mem_fun(*this, &NetLogGuiGtkWindow::on_disconnected), image)); scrolled->show(); label->show(); image->show(); button->show(); logview->show(); hbox->show(); int rv = ntb_logviewers.append_page(*logview, *hbox); return rv; }
void on_thread_back_clicked() { ///To be run when the back button is clicked while viewing a thread boardView(); Gtk::TreeView *threadlist = 0; pWebKitView = WEBKIT_WEB_VIEW (webkit_web_view_new ()); Gtk::ScrolledWindow *imgview = 0; builder->get_widget("scrolledwindow3", imgview); imgview->set_visible(true); imgview->show(); gtk_container_add (GTK_CONTAINER (imgview->gobj()), GTK_WIDGET (pWebKitView)); webkit_web_view_load_uri(pWebKitView, "about:blank"); webkit_web_view_set_zoom_level(pWebKitView, true); gtk_widget_set_can_focus(GTK_WIDGET(pWebKitView), true); gtk_widget_show(GTK_WIDGET(pWebKitView)); builder->get_widget("treeview2", threadlist); Glib::RefPtr<Gtk::TreeSelection> thread_selection = threadlist->get_selection(); thread_selection->signal_changed().connect(sigc::bind<Glib::RefPtr<Gtk::TreeSelection>, WebKitWebView*>(sigc::ptr_fun(&on_selection_changed), thread_selection, pWebKitView)); POST_CLICK_CONNECT.disconnect(); POST_REFRESH_CONNECT.disconnect(); }
void on_button_clicked(Gtk::TreeModel::Path path, Gtk::TreeViewColumn* column, Glib::RefPtr<Gtk::TreeModel> model) { Gtk::TreeModel::iterator iter = model->get_iter(path); Gtk::TreeModel::Row row = *iter; string shortname = row[m_columns.name]; string longname = row[m_columns.longname]; BOARD = shortname; LONGBOARD = longname; boardView(); Gtk::TreeView *threadlist = 0; builder->get_widget("treeview2", threadlist); pWebKitView = WEBKIT_WEB_VIEW (webkit_web_view_new ()); Gtk::ScrolledWindow *imgview = 0; builder->get_widget("scrolledwindow3", imgview); imgview->set_visible(true); imgview->show(); gtk_container_add (GTK_CONTAINER (imgview->gobj()), GTK_WIDGET (pWebKitView)); webkit_web_view_load_uri(pWebKitView, "about:blank"); webkit_web_view_set_zoom_level(pWebKitView, true); gtk_widget_set_can_focus(GTK_WIDGET(pWebKitView), true); gtk_widget_show(GTK_WIDGET(pWebKitView)); Glib::RefPtr<Gtk::ListStore> m_threads_tree_model; m_threads_tree_model = Gtk::ListStore::create(m_thread_list); m_threads_tree_model->clear(); threadlist->set_model(m_threads_tree_model); threadlist->set_search_column(1); threadlist->get_column(1)->set_visible(false); threadlist->get_column(2)->set_visible(false); threadlist->get_column(3)->set_visible(false); threadlist->get_column(4)->set_visible(false); threadlist->signal_key_press_event().connect(sigc::bind<Glib::RefPtr<Gtk::ListStore> >(sigc::ptr_fun(&on_key_press_or_release_event), m_threads_tree_model)); threadlist->signal_key_release_event().connect(sigc::bind<Glib::RefPtr<Gtk::ListStore> >(sigc::ptr_fun(&on_key_press_or_release_event), m_threads_tree_model)); threadlist->add_events(Gdk::KEY_PRESS_MASK | Gdk::KEY_RELEASE_MASK); Gtk::CellRendererText* cellRender = dynamic_cast<Gtk::CellRendererText*>(threadlist->get_column_cell_renderer(0)); cellRender->property_wrap_mode() = Pango::WRAP_WORD; cellRender->property_wrap_width() = 400; cellRender->set_alignment(0, 0); Glib::RefPtr<Gtk::TreeSelection> thread_selection = threadlist->get_selection(); thread_selection->signal_changed().connect(sigc::bind<Glib::RefPtr<Gtk::TreeSelection>, WebKitWebView*>(sigc::ptr_fun(&on_selection_changed), thread_selection, pWebKitView)); getThreadData(m_threads_tree_model); threadlist->grab_focus(); Gtk::ToolButton* refresh; builder->get_widget("toolbutton5", refresh); refresh->set_visible(true); refresh->show(); if(!THREAD_REFRESH_CONNECTED) { THREAD_REFRESH_CONNECT = refresh->signal_clicked().connect(sigc::bind<Glib::RefPtr<Gtk::ListStore> >(sigc::ptr_fun(&on_refresh_threads_clicked), m_threads_tree_model)); } THREAD_CLICK_CONNECT = threadlist->signal_row_activated().connect(sigc::bind<Glib::RefPtr<Gtk::TreeModel>, Glib::RefPtr<Gtk::ListStore> >(sigc::ptr_fun(&on_thread_activated), threadlist->get_model(), m_threads_tree_model)); }
void on_thread_activated(Gtk::TreeModel::Path path, Gtk::TreeViewColumn* column, Glib::RefPtr<Gtk::TreeModel> model, Glib::RefPtr<Gtk::ListStore> store) { ///To be run when a thread is double clicked Gtk::TreeModel::iterator iter = model->get_iter(path); Gtk::TreeModel::Row row = *iter; string no = row[m_thread_list.no]; THREAD = no; cout << THREAD << endl; cout << BOARD << endl; threadView(); Gtk::TreeView *postlist = 0; builder->get_widget("treeview4", postlist); postlist->set_visible(true); postlist->show(); Gtk::ScrolledWindow *imgview = 0; builder->get_widget("scrolledwindow3", imgview); gtk_container_add (GTK_CONTAINER (imgview->gobj()), GTK_WIDGET (pWebKitView)); webkit_web_view_load_uri(pWebKitView, "about:blank"); webkit_web_view_set_zoom_level(pWebKitView, true); gtk_widget_set_can_focus(GTK_WIDGET(pWebKitView), true); gtk_widget_show(GTK_WIDGET(pWebKitView)); Glib::RefPtr<Gtk::ListStore> m_posts_tree_model; m_posts_tree_model = Gtk::ListStore::create(m_post_list); m_posts_tree_model->clear(); postlist->set_model(m_posts_tree_model); postlist->set_search_column(1); postlist->get_column(1)->set_visible(false); postlist->get_column(2)->set_visible(false); postlist->get_column(3)->set_visible(false); postlist->get_column(4)->set_visible(false); postlist->get_column(5)->set_visible(false); postlist->signal_key_press_event().connect(sigc::bind<Glib::RefPtr<Gtk::ListStore> >(sigc::ptr_fun(&on_key_press_thread), m_posts_tree_model)); postlist->signal_key_release_event().connect(sigc::bind<Glib::RefPtr<Gtk::ListStore> >(sigc::ptr_fun(&on_key_press_thread), m_posts_tree_model)); postlist->add_events(Gdk::KEY_PRESS_MASK | Gdk::KEY_RELEASE_MASK); Gtk::CellRendererText* cellRender = dynamic_cast<Gtk::CellRendererText*>(postlist->get_column_cell_renderer(0)); cellRender->property_wrap_mode() = Pango::WRAP_WORD; cellRender->property_wrap_width() = 400; cellRender->set_alignment(0, 0); Glib::RefPtr<Gtk::TreeSelection> thread_selection = postlist->get_selection(); thread_selection->signal_changed().connect(sigc::bind<Glib::RefPtr<Gtk::TreeSelection>, WebKitWebView*>(sigc::ptr_fun(&on_selection_changed_post), thread_selection, pWebKitView)); getPostData(m_posts_tree_model); postlist->grab_focus(); Gtk::ToolButton* refresh; builder->get_widget("toolbutton6", refresh); refresh->set_visible(true); refresh->show(); POST_REFRESH_CONNECT = refresh->signal_clicked().connect(sigc::bind<Glib::RefPtr<Gtk::ListStore> >(sigc::ptr_fun(&on_refresh_posts_clicked), m_posts_tree_model)); Gtk::ScrolledWindow *postwin = 0; builder->get_widget("scrolledwindow4", postwin); postwin->set_visible(true); postwin->show(); POST_CLICK_CONNECT = postlist->signal_row_activated().connect(sigc::bind<Glib::RefPtr<Gtk::TreeModel>, Glib::RefPtr<Gtk::ListStore> >(sigc::ptr_fun(&on_post_activated1), postlist->get_model(), m_posts_tree_model)); }
void threadView() { ///Hide or show widgets for viewing a thread Gtk::ScrolledWindow *boardlist = 0; builder->get_widget("scrolledwindow1", boardlist); boardlist->set_visible(false); boardlist->hide(); Gtk::Paned *threadview = 0; builder->get_widget("paned1", threadview); threadview->set_visible(true); threadview->show(); Gtk::ToolItem *boardback = 0; builder->get_widget("toolbutton4", boardback); boardback->set_visible(true); boardback->show(); Gtk::ToolItem *listback = 0; builder->get_widget("toolbutton3", listback); listback->set_visible(false); listback->hide(); Gtk::Button* button; builder->get_widget("button2", button); button->signal_clicked().connect(sigc::ptr_fun(&on_thread_back_clicked)); button->set_visible(true); button->show(); Gtk::ScrolledWindow *threadlist = 0; builder->get_widget("scrolledwindow2", threadlist); threadlist->set_visible(false); threadlist->hide(); Gtk::ScrolledWindow *postlist = 0; builder->get_widget("scrolledwindow4", postlist); postlist->set_visible(true); postlist->show(); postlist->get_vadjustment()->set_value(0); Gtk::Label *title = 0; builder->get_widget("label2", title); title->set_text("#"+THREAD+" - "+BOARD+" - "+LONGBOARD); Gtk::ToolItem *refresh1 = 0; builder->get_widget("toolbutton5", refresh1); refresh1->set_visible(false); refresh1->hide(); Gtk::ToolItem *refresh2 = 0; builder->get_widget("toolbutton6", refresh2); refresh2->set_visible(true); refresh2->show(); Gtk::MenuItem *item3 = 0; builder->get_widget("menuitem3", item3); item3->set_sensitive(true); Gtk::ToolButton *post_but; builder->get_widget("toolbutton8", post_but); post_but->set_visible(true); post_but->show(); }
void boardView(bool destroy=true) { ///Show/hide widgets for viewing all of the threads on a board Gtk::ScrolledWindow *boardlist = 0; builder->get_widget("scrolledwindow1", boardlist); boardlist->set_visible(false); boardlist->hide(); Gtk::Paned *threadview = 0; builder->get_widget("paned1", threadview); threadview->set_visible(true); threadview->show(); if(INIT) { //To be run only the first time a board is viewed Gtk::Window *window = 0; builder->get_widget("window1", window); int w = 0; int h = 0; window->get_size(w, h); threadview->set_position((1-2/(1+sqrt(5)))*w); Gtk::TextView *view = 0; builder->get_widget("textview1", view); GtkSpellChecker* spell = gtk_spell_checker_new (); gtk_spell_checker_set_language (spell, setlocale(LC_ALL,NULL), NULL); gtk_spell_checker_attach (spell, GTK_TEXT_VIEW (view->gobj())); INIT = false; } Gtk::ToolItem *boardback = 0; builder->get_widget("toolbutton3", boardback); boardback->set_visible(true); boardback->show(); Gtk::ToolItem *threadback = 0; builder->get_widget("toolbutton4", threadback); threadback->set_visible(false); threadback->hide(); Gtk::Button* button; builder->get_widget("button1", button); button->signal_clicked().connect(sigc::ptr_fun(&on_board_back_clicked)); button->set_visible(true); button->show(); Gtk::ScrolledWindow *threadlist = 0; builder->get_widget("scrolledwindow2", threadlist); threadlist->set_visible(true); threadlist->show(); Gtk::ScrolledWindow *postlist = 0; builder->get_widget("scrolledwindow4", postlist); postlist->set_visible(false); postlist->hide(); Gtk::ScrolledWindow *webview = 0; builder->get_widget("scrolledwindow3", webview); webview->set_visible(true); webview->show(); Gtk::ToolButton* refresh; builder->get_widget("toolbutton5", refresh); refresh->set_visible(true); refresh->show(); gtk_widget_show(GTK_WIDGET(pWebKitView)); Gtk::Label *title = 0; builder->get_widget("label2", title); title->set_text(BOARD+" - "+LONGBOARD); Gtk::ToolButton *refresh1 = 0; builder->get_widget("toolbutton5", refresh1); refresh1->set_visible(true); refresh1->show(); Gtk::ToolItem *refresh2 = 0; builder->get_widget("toolbutton6", refresh2); refresh2->set_visible(false); refresh2->hide(); Gtk::MenuItem *item3 = 0; builder->get_widget("menuitem3", item3); item3->set_sensitive(false); Gtk::ToolButton *post_but; builder->get_widget("toolbutton8", post_but); post_but->set_visible(true); post_but->show(); }
Gobby::PreferencesDialog::Appearance::Appearance(Preferences& preferences): m_group_toolbar(_("Toolbar") ), m_group_font(_("Font") ), m_group_scheme(_("Color Scheme")), m_cmb_toolbar_style(preferences.appearance.toolbar_style), m_conn_font(m_btn_font, preferences.appearance.font), m_list(Gtk::ListStore::create(m_columns)), m_tree(m_list) { const Pango::FontDescription& font = preferences.appearance.font; m_cmb_toolbar_style.add(_("Show text only"), Gtk::TOOLBAR_TEXT); m_cmb_toolbar_style.add(_("Show icons only"), Gtk::TOOLBAR_ICONS); m_cmb_toolbar_style.add(_("Show both icons and text"), Gtk::TOOLBAR_BOTH ); m_cmb_toolbar_style.add(_("Show text besides icons"), Gtk::TOOLBAR_BOTH_HORIZ ); m_cmb_toolbar_style.show(); m_conn_font.block(); m_btn_font.set_font_name(font.to_string()); m_btn_font.show(); m_conn_font.unblock(); m_group_toolbar.add(m_cmb_toolbar_style); m_group_toolbar.show(); m_group_font.add(m_btn_font); m_group_font.show(); Gtk::TreeViewColumn column_name; Gtk::CellRendererText renderer_name; column_name.pack_start(renderer_name, false); column_name.add_attribute(renderer_name.property_text(), m_columns.name); m_tree.append_column(column_name);//"Scheme Name", m_columns.name); m_tree.append_column("Scheme description", m_columns.description); Pango::AttrList list; Pango::Attribute attr(Pango::Attribute::create_attr_weight(Pango::WEIGHT_BOLD)); list.insert(attr); renderer_name.property_attributes() = list; m_tree.set_headers_visible(false); m_tree.show(); Gtk::ScrolledWindow* scroll = Gtk::manage(new Gtk::ScrolledWindow); scroll->set_shadow_type(Gtk::SHADOW_IN); scroll->set_policy(Gtk::POLICY_AUTOMATIC, Gtk::POLICY_AUTOMATIC); scroll->add(m_tree); scroll->show(); m_group_scheme.add(*scroll); m_group_scheme.show(); GtkSourceStyleSchemeManager* manager = gtk_source_style_scheme_manager_get_default(); const gchar* const* ids = gtk_source_style_scheme_manager_get_scheme_ids(manager); Glib::ustring current_scheme = preferences.appearance.scheme_id; for (const gchar* const* id = ids; *id != NULL; ++id) { GtkSourceStyleScheme* scheme = gtk_source_style_scheme_manager_get_scheme(manager, *id); const gchar* name = gtk_source_style_scheme_get_name(scheme); const gchar* desc = gtk_source_style_scheme_get_description(scheme); Gtk::TreeIter iter = m_list->append(); (*iter)[m_columns.name] = name; (*iter)[m_columns.description] = desc; (*iter)[m_columns.scheme] = scheme; if (current_scheme == gtk_source_style_scheme_get_id(scheme)) m_tree.get_selection()->select(iter); } m_tree.get_selection()->signal_changed().connect( sigc::bind( sigc::mem_fun(*this, &Appearance::on_scheme_changed), sigc::ref(preferences))); #ifdef USE_GTKMM3 m_list->set_sort_column(m_columns.name, Gtk::SORT_ASCENDING); #else m_list->set_sort_column_id(m_columns.name, Gtk::SORT_ASCENDING); #endif add(m_group_toolbar, false); add(m_group_font, false); add(m_group_scheme, true); }
aboutDialog::aboutDialog() { Gtk::Dialog *ad = this; Gtk::Button *okbutton = Gtk::manage(new class Gtk::Button("ok")); Gtk::Label *aboutLabel = Gtk::manage(new class Gtk::Label( "About " + GPD->sGUI_CLIENT() + " " + GPD->sVERSION() + ", build " + GPD->sBUILD() )); Gtk::TextView *textview = Gtk::manage(new class Gtk::TextView()); Gtk::ScrolledWindow *scrolledwindow = Gtk::manage(new class Gtk::ScrolledWindow()); Gtk::VBox *vbox = Gtk::manage(new class Gtk::VBox(false, 0)); okbutton->set_flags(Gtk::CAN_FOCUS); okbutton->set_relief(Gtk::RELIEF_NORMAL); ad->get_action_area()->property_layout_style().set_value(Gtk::BUTTONBOX_END); ad->set_default_size(300, 200); aboutLabel->set_alignment(0.5,0.5); aboutLabel->set_padding(0,0); aboutLabel->set_justify(Gtk::JUSTIFY_LEFT); aboutLabel->set_line_wrap(false); aboutLabel->set_use_markup(false); aboutLabel->set_selectable(false); textview->set_flags(Gtk::CAN_FOCUS); textview->set_editable(true); textview->set_cursor_visible(true); textview->set_pixels_above_lines(0); textview->set_pixels_below_lines(0); textview->set_pixels_inside_wrap(0); textview->set_left_margin(0); textview->set_right_margin(0); textview->set_indent(0); textview->set_wrap_mode(Gtk::WRAP_NONE); textview->set_justification(Gtk::JUSTIFY_LEFT); using namespace std; string text; text += "btg Copyright (C) 2005 Michael Wojciechowski."; text += GPD->sNEWLINE(); text += "This program is free software; you can redistribute it and/or modify"; text += GPD->sNEWLINE(); text += "it under the terms of the GNU General Public License as published by "; text += GPD->sNEWLINE(); text += "the Free Software Foundation; either version 2 of the License, or "; text += GPD->sNEWLINE(); text += "(at your option) any later version."; text += GPD->sNEWLINE(); text += "This program is distributed in the hope that it will be useful, "; text += GPD->sNEWLINE(); text += "but WITHOUT ANY WARRANTY; without even the implied warranty of "; text += GPD->sNEWLINE(); text += "MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the "; text += GPD->sNEWLINE(); text += "GNU General Public License for more details."; text += GPD->sNEWLINE(); text += "You should have received a copy of the GNU General Public License "; text += GPD->sNEWLINE(); text += "along with this program; if not, write to the Free Software "; text += GPD->sNEWLINE(); text += "Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA"; text += GPD->sNEWLINE(); textview->get_buffer()->set_text(text); scrolledwindow->set_flags(Gtk::CAN_FOCUS); scrolledwindow->set_shadow_type(Gtk::SHADOW_IN); scrolledwindow->set_policy(Gtk::POLICY_AUTOMATIC, Gtk::POLICY_AUTOMATIC); scrolledwindow->property_window_placement().set_value(Gtk::CORNER_TOP_LEFT); scrolledwindow->add(*textview); vbox->pack_start(*aboutLabel, Gtk::PACK_SHRINK, 0); vbox->pack_start(*scrolledwindow); ad->get_vbox()->set_homogeneous(false); ad->get_vbox()->set_spacing(0); ad->get_vbox()->pack_start(*vbox); //ad->set_title( "About " + GPD->sGUI_CLIENT() + " " + GPD->sVERSION() ); ad->set_title( GPD->sGUI_CLIENT() + " " + GPD->sVERSION() + " / About" ); ad->set_modal(true); ad->property_window_position().set_value(Gtk::WIN_POS_CENTER); ad->set_resizable(true); ad->property_destroy_with_parent().set_value(false); ad->set_has_separator(true); ad->add_action_widget(*okbutton, -5); okbutton->show(); aboutLabel->show(); textview->show(); scrolledwindow->show(); vbox->show(); okbutton->signal_clicked().connect(sigc::mem_fun(*this, &aboutDialog::on_ok_clicked)); // ad->show(); }
void DataSet::initGtk() { _gtkOptList.reset(new Gtk::VBox); {//The heading of the data set window Gtk::Frame* frame = Gtk::manage(new Gtk::Frame("Data Set Information")); frame->show(); _gtkOptList->pack_start(*frame, false, true, 5); Gtk::VBox* vbox = Gtk::manage(new Gtk::VBox); vbox->show(); frame->add(*vbox); _infolabel.reset(new Gtk::Label("Points: " + boost::lexical_cast<std::string>(_N))); _infolabel->show(); vbox->pack_start(*_infolabel, false, true, 5); } //Glyph adding mechanism { Gtk::HBox* box = Gtk::manage(new Gtk::HBox); box->show(); _gtkOptList->pack_start(*box, false, false, 5); _comboPointSet.reset(new Gtk::ComboBoxText); _comboPointSet->show(); box->pack_start(*_comboPointSet, false, false, 5); //Check the combo box is correct _comboPointSet->get_model().clear(); for (const auto& pointset: _pointSets) _comboPointSet->insert(-1, pointset.first); _comboPointSet->set_active(0); Gtk::Button* btn = Gtk::manage(new Gtk::Button("Add Glyphs")); btn->signal_clicked().connect(sigc::mem_fun(*this, &DataSet::addGlyphs)); btn->show(); box->pack_start(*btn, false, false, 5); _comboLinkSet.reset(new Gtk::ComboBoxText); _comboLinkSet->show(); box->pack_start(*_comboLinkSet, false, false, 5); //Check the combo box is correct _comboLinkSet->get_model().clear(); for (const auto& linkset: _linkSets) _comboLinkSet->insert(-1, linkset.first); _comboLinkSet->set_active(0); btn = Gtk::manage(new Gtk::Button("Add Links")); btn->signal_clicked().connect(sigc::mem_fun(*this, &DataSet::addLinkGlyphs)); btn->show(); box->pack_start(*btn, false, false, 5); } { _attrcolumns.reset(new ModelColumns); _attrtreestore = Gtk::TreeStore::create(*_attrcolumns); _attrtreestore->set_sort_column(_attrcolumns->components, Gtk::SORT_DESCENDING); _attrview.reset(new Gtk::TreeView); _attrview->set_model(_attrtreestore); _attrview->append_column("Name", _attrcolumns->name); _attrview->append_column("Components", _attrcolumns->components); _attrview->append_column("Min Values", _attrcolumns->min); _attrview->append_column("Max Values", _attrcolumns->max); _attrview->show(); Gtk::ScrolledWindow* win = Gtk::manage(new Gtk::ScrolledWindow); win->set_policy(Gtk::POLICY_AUTOMATIC, Gtk::POLICY_AUTOMATIC); win->add(*_attrview); Gtk::Frame* frame = Gtk::manage(new Gtk::Frame("Available Attributes")); frame->show(); frame->add(*win); _gtkOptList->pack_start(*frame, true, true, 5); win->show(); } { _positionSel.reset(new AttributeSelector(false)); _gtkOptList->pack_start(*_positionSel, false, false); } _gtkOptList->show(); rebuildGui(); }