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::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; }
// tileset list window level_editor::tileset_list::tileset_list(window& _window, preferences& _preferences) : Gtk::Dialog("Tileset list", _window, false, false), m_window(_window), m_preferences(_preferences) { m_list_store = Gtk::ListStore::create(columns); m_tree_view.set_model(m_list_store); // Add editable "active" column m_tree_view.append_column("Active", columns.active); Gtk::CellRendererToggle* renderer = dynamic_cast<Gtk::CellRendererToggle*>(m_tree_view.get_column_cell_renderer(0)); // For some reason there's no set_activatable function for CellRendererToggle on gtkmm 2.16 windows Glib::PropertyProxy<bool> activatable = renderer->property_activatable(); activatable.set_value(true); renderer->signal_toggled().connect(sigc::mem_fun( this, &tileset_list::on_active_toggled)); m_tree_view.append_column("Image", columns.image); m_tree_view.append_column("Prefix", columns.prefix); m_tree_view.append_column("X", columns.x); m_tree_view.append_column("Y", columns.y); m_tree_view.append_column("Main", columns.main); Gtk::ScrolledWindow* scrolled = Gtk::manage(new Gtk::ScrolledWindow()); scrolled->set_policy(Gtk::POLICY_AUTOMATIC, Gtk::POLICY_AUTOMATIC); scrolled->set_shadow_type(Gtk::SHADOW_IN); scrolled->add(m_tree_view); get_vbox()->pack_start(*scrolled); Gtk::Button* button_new = Gtk::manage(new Gtk::Button("New")); button_new->signal_clicked().connect(sigc::mem_fun(this, &tileset_list::on_new_clicked)); get_action_area()->pack_start(*button_new); Gtk::Button* button_edit = Gtk::manage(new Gtk::Button("Edit")); button_edit->signal_clicked().connect(sigc::mem_fun(this, &tileset_list::on_edit_clicked)); get_action_area()->pack_start(*button_edit); Gtk::Button* button_delete = Gtk::manage(new Gtk::Button("Delete")); button_delete->signal_clicked().connect(sigc::mem_fun(this, &tileset_list::on_delete_clicked)); get_action_area()->pack_start(*button_delete); add_button(Gtk::Stock::CLOSE, Gtk::RESPONSE_CLOSE); set_default_size(400, 300); show_all_children(); }
Gtk::Widget* Dock_History::create_action_tree() { studio::HistoryTreeStore::Model history_tree_model; action_tree=manage(new class Gtk::TreeView()); { Gtk::TreeView::Column* column = Gtk::manage( new Gtk::TreeView::Column("") ); Gtk::CellRendererToggle* toggle_cr = Gtk::manage( new Gtk::CellRendererToggle() ); toggle_cr->signal_toggled().connect(sigc::mem_fun(*this, &studio::Dock_History::on_action_toggle) ); column->pack_start(*toggle_cr); //false = don't expand. column->add_attribute(toggle_cr->property_active(),history_tree_model.is_active); column->set_resizable(); column->set_clickable(); action_tree->append_column(*column); } /*{ Gtk::TreeView::Column* column = Gtk::manage( new Gtk::TreeView::Column(_("Canvas")) ); Gtk::CellRendererText *text_cr=Gtk::manage(new Gtk::CellRendererText()); text_cr->property_foreground()=Glib::ustring("#7f7f7f"); column->pack_start(*text_cr); column->add_attribute(text_cr->property_text(),history_tree_model.canvas_id); column->add_attribute(text_cr->property_foreground_set(),history_tree_model.is_redo); action_tree->append_column(*column); }*/ { Gtk::TreeView::Column* column = Gtk::manage( new Gtk::TreeView::Column(_("Jump")) ); Gtk::CellRendererText* cell_renderer_jump=Gtk::manage(new Gtk::CellRendererText()); column->pack_start(*cell_renderer_jump,true); cell_renderer_jump->property_text()=_("(JMP)"); cell_renderer_jump->property_foreground()="#003a7f"; column->set_resizable(); column->set_clickable(); column->set_sort_column(COLUMNID_JUMP); action_tree->append_column(*column); //column->clicked(); } { Gtk::TreeView::Column* column = Gtk::manage( new Gtk::TreeView::Column(_("Action")) ); Gtk::CellRendererText *text_cr=Gtk::manage(new Gtk::CellRendererText()); text_cr->property_foreground()=Glib::ustring("#7f7f7f"); //column->pack_start(history_tree_model.icon, false); //false = don't expand. column->pack_start(*text_cr); column->add_attribute(text_cr->property_text(),history_tree_model.name); column->add_attribute(text_cr->property_foreground_set(),history_tree_model.is_redo); action_tree->append_column(*column); } action_tree->set_enable_search(true); action_tree->set_search_column(history_tree_model.name); action_tree->set_search_equal_func(sigc::ptr_fun(&studio::HistoryTreeStore::search_func)); action_tree->set_rules_hint(); // action_tree->signal_row_activated().connect(sigc::mem_fun(*this,&Dock_History::on_row_activate)); action_tree->signal_event().connect(sigc::mem_fun(*this,&Dock_History::on_action_event)); // action_tree->add_events(Gdk::BUTTON_PRESS_MASK | Gdk::BUTTON_RELEASE_MASK); // action_tree->add_events(Gdk::BUTTON1_MOTION_MASK); action_tree->show(); Gtk::ScrolledWindow *scrolledwindow = manage(new class Gtk::ScrolledWindow()); scrolledwindow->set_flags(Gtk::CAN_FOCUS); scrolledwindow->set_policy(Gtk::POLICY_AUTOMATIC, Gtk::POLICY_AUTOMATIC); scrolledwindow->add(*action_tree); scrolledwindow->set_shadow_type(Gtk::SHADOW_ETCHED_IN); scrolledwindow->show_all(); /* { Gtk::Widget& widget(*action_tree); Pango::FontDescription font(widget.get_modifier_style()->get_font()); font.set_size(Pango::SCALE*5); widget.get_modifier_style()->set_font(font); widget.modify_font(font); } */ return scrolledwindow; }
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); }
BugzillaPreferences::BugzillaPreferences() : Gtk::VBox(false, 12) { _init_static(); last_opened_dir = Glib::get_home_dir(); Gtk::Label *l = manage(new Gtk::Label (_("You can use any bugzilla just by dragging links " "into notes. If you want a special icon for " "certain hosts, add them here."))); l->property_wrap() = true; l->property_xalign() = 0; pack_start(*l, false, false, 0); icon_store = Gtk::ListStore::create(m_columns); icon_store->set_sort_column(m_columns.host, Gtk::SORT_ASCENDING); icon_tree = manage(new Gtk::TreeView (icon_store)); icon_tree->set_headers_visible(true); icon_tree->get_selection()->set_mode(Gtk::SELECTION_SINGLE); icon_tree->get_selection()->signal_changed().connect( sigc::mem_fun(*this, &BugzillaPreferences::selection_changed)); Gtk::TreeViewColumn *host_col = manage(new Gtk::TreeViewColumn(_("Host Name"), m_columns.host)); host_col->set_sizing(Gtk::TREE_VIEW_COLUMN_AUTOSIZE); host_col->set_resizable(true); host_col->set_expand(true); host_col->set_min_width(200); host_col->set_sort_column(m_columns.host); host_col->set_sort_indicator(false); host_col->set_reorderable(false); host_col->set_sort_order(Gtk::SORT_ASCENDING); icon_tree->append_column (*host_col); Gtk::TreeViewColumn *icon_col = manage(new Gtk::TreeViewColumn(_("Icon"), m_columns.icon)); icon_col->set_sizing(Gtk::TREE_VIEW_COLUMN_FIXED); icon_col->set_max_width(50); icon_col->set_min_width(50); icon_col->set_resizable(false); icon_tree->append_column (*icon_col); Gtk::ScrolledWindow *sw = manage(new Gtk::ScrolledWindow ()); sw->set_shadow_type(Gtk::SHADOW_IN); sw->property_height_request() = 200; sw->property_width_request() = 300; sw->set_policy (Gtk::POLICY_AUTOMATIC, Gtk::POLICY_AUTOMATIC); sw->add (*icon_tree); pack_start(*sw, true, true, 0); add_button = manage(new Gtk::Button (Gtk::Stock::ADD)); add_button->signal_clicked().connect( sigc::mem_fun(*this, &BugzillaPreferences::add_clicked)); remove_button = manage(new Gtk::Button (Gtk::Stock::REMOVE)); remove_button->set_sensitive(false); remove_button->signal_clicked().connect( sigc::mem_fun(*this, &BugzillaPreferences::remove_clicked)); Gtk::HButtonBox *hbutton_box = manage(new Gtk::HButtonBox ()); hbutton_box->set_layout(Gtk::BUTTONBOX_START); hbutton_box->set_spacing(6); hbutton_box->pack_start(*add_button); hbutton_box->pack_start(*remove_button); pack_start(*hbutton_box, false, false, 0); show_all (); }
void ResViewerViewImpl::setFileContentsByName(std::map<std::string, Glib::RefPtr<Gtk::TextBuffer> > FileContents) { Glib::ustring ExistingTabSelection = ""; if (mp_Notebook->get_current()) ExistingTabSelection = mp_Notebook->get_current()->get_tab_label_text(); int TabToSelect = 0; while (mp_Notebook->get_n_pages() > 1) mp_Notebook->remove_page(1); for (std::map<std::string, Glib::RefPtr<Gtk::TextBuffer> >::iterator it = FileContents.begin(); it != FileContents.end(); ++it) { Gtk::TextView* TextView = Gtk::manage(new Gtk::TextView(it->second)); TextView->set_editable(false); TextView->set_visible(true); Gtk::ScrolledWindow* Win = Gtk::manage(new Gtk::ScrolledWindow()); Win->set_policy(Gtk::POLICY_AUTOMATIC, Gtk::POLICY_AUTOMATIC); Win->set_visible(true); Win->set_shadow_type(Gtk::SHADOW_ETCHED_IN); Win->add(*TextView); Gtk::Label* TabLabel = Gtk::manage(new Gtk::Label(it->first)); Gtk::Label* MenuLabel = Gtk::manage(new Gtk::Label(it->first, Gtk::ALIGN_LEFT, Gtk::ALIGN_CENTER)); Gtk::Button* SingleGNUplotButton = Gtk::manage(new Gtk::Button( _("Plot file with GNUplot\n(All-in-one window)"))); Gtk::Button* MultiGNUplotButton = Gtk::manage(new Gtk::Button( _("Plot file with GNUplot\n(Multiple windows)"))); Gtk::VBox* RightButtonsBox = Gtk::manage(new Gtk::VBox()); RightButtonsBox->pack_start(*SingleGNUplotButton, Gtk::PACK_SHRINK); RightButtonsBox->pack_start(*MultiGNUplotButton, Gtk::PACK_SHRINK, 5); RightButtonsBox->show_all_children(true); RightButtonsBox->set_visible(true); #if WIN32 SingleGNUplotButton->set_sensitive(false); MultiGNUplotButton->set_sensitive(false); #else if (ViewWithGNUplot::IsGNUplotAvailable()) { SingleGNUplotButton->signal_clicked().connect(sigc::bind<Glib::RefPtr< Gtk::TextBuffer>, std::string, std::string, std::string, bool>( sigc::mem_fun(*this, &ResViewerViewImpl::onGNUplotClicked), (Glib::RefPtr<Gtk::TextBuffer>) (it->second), m_DateFormat, m_ColSep, m_CommentChar, true)); SingleGNUplotButton->set_sensitive(true); MultiGNUplotButton->signal_clicked().connect(sigc::bind<Glib::RefPtr< Gtk::TextBuffer>, std::string, std::string, std::string, bool>( sigc::mem_fun(*this, &ResViewerViewImpl::onGNUplotClicked), (Glib::RefPtr<Gtk::TextBuffer>) (it->second), m_DateFormat, m_ColSep, m_CommentChar, false)); MultiGNUplotButton->set_sensitive(true); } else { SingleGNUplotButton->set_sensitive(false); MultiGNUplotButton->set_sensitive(false); } #endif Gtk::HBox* MainHBox = Gtk::manage(new Gtk::HBox()); MainHBox->pack_start(*Win, Gtk::PACK_EXPAND_WIDGET, 5); MainHBox->pack_start(*RightButtonsBox, Gtk::PACK_SHRINK, 5); MainHBox->set_border_width(8); MainHBox->set_visible(true); int PageNum = mp_Notebook->append_page(*MainHBox, *TabLabel, *MenuLabel); if (it->first == ExistingTabSelection) TabToSelect = PageNum; mp_Notebook->set_tab_reorderable(*Win, true); } mp_Notebook->set_current_page(TabToSelect); }
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(); }
MEItemInfoWidget::MEItemInfoWidget() : MEAbstractItemInfoWidget("General") { Gtk::Table* table = manage(new Gtk::Table(5, 2)); // Item type Gtk::Label* label = manage(new Gtk::Label("Item type")); label->set_alignment(XALIGN, YALIGN); table->attach(*label, 0, 1, 0, 1, Gtk::FILL, Gtk::FILL); m_itemTypeVal = manage(new Gtk::Entry()); table->attach(*m_itemTypeVal, 1, 2, 0, 1, Gtk::EXPAND | Gtk::FILL, Gtk::FILL); // ID label = manage(new Gtk::Label("Item ID")); label->set_alignment(XALIGN, YALIGN); table->attach(*label, 0, 1, 1, 2, Gtk::FILL, Gtk::FILL); m_itemIDVal = manage(new Gtk::Entry()); table->attach(*m_itemIDVal, 1, 2, 1, 2, Gtk::EXPAND | Gtk::FILL, Gtk::FILL); /* Groups */ label = manage(new Gtk::Label("Groups")); label->set_alignment(XALIGN, YALIGN); //table->attach(*label, 0, 1, 3, 4, FIXED_OPT, FIXED_OPT); // Create scrolled window and add viewer Gtk::ScrolledWindow* scrolledWin = manage(new Gtk::ScrolledWindow()); scrolledWin->set_policy(Gtk::POLICY_AUTOMATIC, Gtk::POLICY_AUTOMATIC); scrolledWin->set_shadow_type(Gtk::SHADOW_OUT); scrolledWin->add(m_treeViewGroups); table->attach(*scrolledWin, 1, 2, 3, 4, Gtk::EXPAND | Gtk::FILL, Gtk::EXPAND | Gtk::FILL); // Create ListStore and add to treeViewer. m_listStoreGroups = Gtk::ListStore::create(m_columnsGroups); m_treeViewGroups.set_model(m_listStoreGroups); // Create selection object m_selectionGroups = m_treeViewGroups.get_selection(); // Add columns to the treeviewer m_treeViewGroups.append_column("Pos", m_columnsGroups.m_pos); m_treeViewGroups.append_column("ID", m_columnsGroups.m_ID); m_treeViewGroups.append_column("Type", m_columnsGroups.m_type); m_treeViewGroups.append_column("Name", m_columnsGroups.m_name); // Set column widths m_treeViewGroups.get_column(0)->set_min_width(30); m_treeViewGroups.get_column(1)->set_min_width(60); m_treeViewGroups.get_column(2)->set_min_width(60); m_treeViewGroups.get_column(3)->set_min_width(60); // Add a button to be able to select group Gtk::Box* tmpBox1 = manage(new Gtk::VBox()); tmpBox1->pack_start(*label); Gtk::Button* tmpButton1=manage(new Gtk::Button("Select")); tmpBox1->pack_start(*tmpButton1, false, false); tmpButton1->signal_clicked().connect( sigc::mem_fun(*this, &MEItemInfoWidget::groupClicked)); table->attach(*tmpBox1, 0, 1, 3, 4, Gtk::FILL, Gtk::FILL | Gtk::EXPAND); m_listStoreGroups = Gtk::ListStore::create(m_columnsGroups); m_treeViewGroups.set_model(m_listStoreGroups); /* Names */ // Label label = manage(new Gtk::Label("Names")); label->set_alignment(XALIGN, YALIGN); #ifdef MAP_EDITABLE // Add a button to be able to edit the names of this item Gtk::Box* tmpBox = manage(new Gtk::VBox()); tmpBox->pack_start(*label); Gtk::Button* tmpButton=manage(new Gtk::Button("Edit")); //tmpButton->set_usize(20,12); tmpBox->pack_start(*tmpButton, false, false); tmpButton->signal_clicked().connect( sigc::mem_fun(*this, &MEItemInfoWidget::editNamePressed)); table->attach(*tmpBox, 0, 1, 4, 5, Gtk::FILL, Gtk::FILL | Gtk::EXPAND); #else table->attach(*label, 0, 1, 4, 5, Gtk::FILL, Gtk::FILL | Gtk::EXPAND); #endif // MAP_EDITABLE // Create scrollwindow and add viewer scrolledWin = manage(new Gtk::ScrolledWindow()); scrolledWin->set_shadow_type(Gtk::SHADOW_OUT); scrolledWin->set_policy(Gtk::POLICY_AUTOMATIC, Gtk::POLICY_AUTOMATIC); scrolledWin->add(m_treeViewNames); table->attach(*scrolledWin, 1, 2, 4, 5, Gtk::FILL, Gtk::FILL); // Create ListStore and add to TreeViewer m_listStoreNames = Gtk::ListStore::create(m_ColumnsNames); m_treeViewNames.set_model(m_listStoreNames); // Create selection object m_selectionNames = m_treeViewNames.get_selection(); // Add columns to TreeViewer m_treeViewNames.append_column("Names", m_ColumnsNames.m_name); m_treeViewNames.set_headers_visible(false); //m_itemIDVal->set_state(GTK_STATE_INSENSITIVE); m_itemIDVal->set_editable(false); //m_itemTypeVal->set_state(GTK_STATE_INSENSITIVE); m_itemTypeVal->set_editable(false); #ifdef MAP_EDITABLE m_selectionNames->set_mode(Gtk::SELECTION_SINGLE); #else m_selectionNames->set_mode(Gtk::SELECTION_NONE); #endif // Add the table to this frame add(*table); }