DebuggingPage::DebuggingPage(CommandProxy& proxy) : m_proxy(proxy), m_stacklist(1, false), m_dbglist(4, false) { m_stacklist.get_column(0)->set_title("Undoable commands"); m_dbglist.get_column(0)->set_title("Level"); m_dbglist.get_column(1)->set_title("Source file"); m_dbglist.get_column(2)->set_title("Code line"); m_dbglist.get_column(3)->set_title("Message"); Gtk::VBox* vbox = manage(new Gtk::VBox); add(*vbox); Gtk::ScrolledWindow* stackscrw = manage(new Gtk::ScrolledWindow); stackscrw->set_policy(Gtk::POLICY_AUTOMATIC, Gtk::POLICY_AUTOMATIC); vbox->pack_start(*stackscrw); stackscrw->add(m_stacklist); Gtk::ScrolledWindow* dbgscrw = manage(new Gtk::ScrolledWindow); dbgscrw->set_policy(Gtk::POLICY_AUTOMATIC, Gtk::POLICY_AUTOMATIC); vbox->pack_start(*dbgscrw); dbgscrw->add(m_dbglist); signal_debug.connect(sigc::mem_fun(*this, &DebuggingPage::add_debug_msg)); reset_gui(); }
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; }
Gtk::ScrolledWindow* editor_view::getEditor(string sLM){ /* Create a Scrolled Window that will contain the GtkSourceView */ Gtk::ScrolledWindow* pScrollWin = new Gtk::ScrolledWindow (); pScrollWin->set_policy (Gtk::POLICY_AUTOMATIC, Gtk::POLICY_AUTOMATIC); //GtkSourceView* sv = new GtkSourceView(); Gsv::View* sv = getView(sLM); //Gtk::VBox* vb = new Gtk::VBox(); //vb->pack_start(*sv); pScrollWin->add(*sv); return pScrollWin ; }
Gtk::Box *SmartChessWindow::createLogArea() { Gtk::Box * box = Gtk::manage(new Gtk::Box(Gtk::ORIENTATION_VERTICAL)); box->set_vexpand(); box->set_hexpand(false); Gtk::TextView* pTextView = Gtk::manage(new Gtk::TextView(Gtk::TextBuffer::create())); pTextView->set_vexpand(); pTextView->set_hexpand(false); Gtk::ScrolledWindow* scrolledWindow = Gtk::manage(new Gtk::ScrolledWindow()); scrolledWindow->set_vexpand(); scrolledWindow->set_hexpand(false); scrolledWindow->add(*pTextView); box->pack_end(*scrolledWindow); return box; }
void AsistenteJerarquia::enlazarWidgets() { Gtk::Button* bAceptar = 0; Gtk::Button* bCancelar = 0; Gtk::Entry *entryNombre = 0; Gtk::ScrolledWindow* scrollLista = 0; Gtk::Fixed * fixed = 0; this->m_builder->get_widget("bAceptar", bAceptar); this->m_builder->get_widget("bCancelar", bCancelar); this->m_builder->get_widget("entryNombre", entryNombre); this->m_builder->get_widget("fixed3", fixed); bAceptar->signal_clicked().connect(sigc::mem_fun(*this, &AsistenteJerarquia::on_botonAceptar_click)); bCancelar->signal_clicked().connect(sigc::mem_fun(*this, &AsistenteJerarquia::on_botonCancelar_click)); this->comboBox.signal_changed().connect(sigc::mem_fun(*this, &AsistenteJerarquia::on_ComboBox_click)); this->signal_hide().connect(sigc::mem_fun(*this, &AsistenteJerarquia::on_about_hide)); //Lista this->m_builder->get_widget("scrollLista", scrollLista); scrollLista->add(this->treeView); this->refTreeModel = Gtk::ListStore::create(this->m_Columnas); //Agrego modelo a treeview this->treeView.set_model(this->refTreeModel); this->treeView.append_column("Nombre", this->m_Columnas.m_col_Nombre); this->treeView.append_column_editable("Selected", this->m_Columnas.m_col_selected); this->refTreeModelCombo = Gtk::ListStore::create(this->m_ColumnasCombo); this->comboBox.set_model(this->refTreeModelCombo); this->comboBox.pack_start(this->m_ColumnasCombo.m_col_Nombre); this->comboBox.set_active(0); this->comboBox.set_size_request(120,25); fixed->put(this->comboBox,200,50); this->treeView.show(); this->show_all(); }
//TODO: klasse soll window extenden (schoener so) EwAccountsWin::EwAccountsWin() { EWLOG("In EwAccountsWin::EwAccountsWin()", 8); Glib::RefPtr<Gtk::Builder> builder = Gtk::Builder::create_from_file("data/EwAccountsWin.glade"); Gtk::Button *add, *del, *close; Gtk::ScrolledWindow *scrolledwindow; builder->get_widget("EwAccounts", window); builder->get_widget("add", add); builder->get_widget("delete", del); builder->get_widget("close", close); builder->get_widget("scrolledwindow", scrolledwindow); scrolledwindow->add(treeView); add->signal_clicked().connect(sigc::mem_fun(this, &EwAccountsWin::onAddBtnClicked)); del->signal_clicked().connect(sigc::mem_fun(this, &EwAccountsWin::onDelBtnClicked)); close->signal_clicked().connect(sigc::mem_fun(this, &EwAccountsWin::onCloseBtnClicked)); liststore = Gtk::ListStore::create(m_Columns); treeView.set_model(liststore); treeView.append_column("Enabled", m_Columns.m_col_enab); treeView.append_column_editable("Identifier", m_Columns.m_col_identifier); treeView.append_column("Use Https", m_Columns.m_col_https); Gtk::CellRendererText *crtu; Gtk::CellRendererToggle *crtenab, *crthttps; crtenab = dynamic_cast<Gtk::CellRendererToggle*>(treeView.get_column_cell_renderer(0)); crtenab->set_activatable(); crtenab->signal_toggled().connect(sigc::mem_fun(this, &EwAccountsWin::onColumnEnabledToggled)); crtu = dynamic_cast<Gtk::CellRendererText*>(treeView.get_column_cell_renderer(1)); crtu->signal_edited().connect(sigc::mem_fun(this, &EwAccountsWin::onColumnIdentifierChanged)); crthttps = dynamic_cast<Gtk::CellRendererToggle*>(treeView.get_column_cell_renderer(2)); crthttps->set_activatable(); crthttps->signal_toggled().connect(sigc::mem_fun(this, &EwAccountsWin::onColumnHttpsToggled)); std::list<EwAccountList::EwAccount> accounts = EwAccountList::Instance()->getAccounts(); for (std::list<EwAccountList::EwAccount>::iterator iter = accounts.begin(); iter != accounts.end(); iter++) { Gtk::TreeModel::Row row = *(liststore->append()); row[m_Columns.m_col_id] = (*iter).id; row[m_Columns.m_col_identifier] = (*iter).identifier; row[m_Columns.m_col_enab] = (*iter).enabled; row[m_Columns.m_col_https] = (*iter).https; } window->show_all_children(); Gtk::Main::run(*window); }
// 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(); }
ResViewerViewImpl::ResViewerViewImpl() { ViewWithGNUplot::FindGNUplot(); mp_MainBox = Gtk::manage(new Gtk::VBox()); mp_TitleLabel = Gtk::manage(new Gtk::Label()); mp_TreeView = Gtk::manage(new Gtk::TreeView()); Gtk::ScrolledWindow* Win = Gtk::manage(new Gtk::ScrolledWindow()); Win->set_policy(Gtk::POLICY_AUTOMATIC, Gtk::POLICY_AUTOMATIC); Win->set_border_width(5); Win->add(*mp_TreeView); mp_MainBox->pack_start(*Win); mp_MainBox->show_all_children(); mp_Notebook = Gtk::manage(new Gtk::Notebook()); mp_Notebook->set_scrollable(true); mp_Notebook->popup_enable(); mp_Notebook->append_page(*mp_MainBox, _("Tabular view")); }
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; }
MainWindow::MainWindow() { set_title("Handle Project"); set_icon_from_file("images/HaPr_high_80x100_ver2.gif"); set_size_request(200, 200); set_default_size(500, 300); set_position(Gtk::WIN_POS_CENTER); signal_hide().connect(sigc::mem_fun(*this, &MainWindow::on_action_file_exit)); Gtk::VBox *const main_box = new Gtk::VBox(false, 0); add(*Gtk::manage(main_box)); create_menu(main_box); std::list<Project> active_projects = get_projects_from_db(); Glib::ustring str_no_proj, str_late_proj, str_history_proj; std::stringstream ss, ss2, ss3; no_active = active_projects.size(); ss << no_active; ss >> str_no_proj; std::list<Project> hist_projects = get_projects_from_db(HISTORY_PROJECT); no_history = hist_projects.size(); ss3 << no_history; ss3 >> str_history_proj; no_late = 0; for(std::list<Project>::iterator it = active_projects.begin(); it != active_projects.end(); it++) { if(it->is_late()) no_late++; } ss2 << no_late; ss2 >> str_late_proj; treeview = new Gtk::TreeView(); Gtk::manage(treeview); scrollview.add(*treeview); scrollview.set_policy(Gtk::POLICY_AUTOMATIC, Gtk::POLICY_AUTOMATIC); treeviewhist = new Gtk::TreeView(); Gtk::manage(treeviewhist); Gtk::ScrolledWindow *scrollhistory = new Gtk::ScrolledWindow(); Gtk::manage(scrollhistory); scrollhistory->add(*treeviewhist); scrollhistory->set_policy(Gtk::POLICY_AUTOMATIC, Gtk::POLICY_AUTOMATIC); tabview = new Gtk::Notebook(); Gtk::manage(tabview); tabview->append_page(scrollview, _("_Active projects"), true); tabview->append_page(*scrollhistory, _("P_roject history"), true); main_box->pack_start(*tabview); //Table for active projects. Gtk::TreeModel::ColumnRecord *col_record = new Gtk::TreeModel::ColumnRecord(); col_id = new Gtk::TreeModelColumn<time_t>(); col_no = new Gtk::TreeModelColumn<std::string>(); col_name = new Gtk::TreeModelColumn<std::string>(); col_desc = new Gtk::TreeModelColumn<std::string>(); col_leader_name = new Gtk::TreeModelColumn<std::string>(); col_leader_surname = new Gtk::TreeModelColumn<std::string>(); col_start_date = new Gtk::TreeModelColumn<std::string>(); col_end_date = new Gtk::TreeModelColumn<std::string>(); col_record->add(*col_id); col_record->add(*col_no); col_record->add(*col_name); col_record->add(*col_desc); col_record->add(*col_leader_name); col_record->add(*col_leader_surname); col_record->add(*col_start_date); col_record->add(*col_end_date); ref_tree_model = Gtk::ListStore::create(*col_record); treeview->set_model(ref_tree_model); int j = 0; Gtk::TreeModel::Row row; for(std::list<Project>::iterator it = active_projects.begin(); it != active_projects.end(); it++) { row = *(ref_tree_model->append()); row[*col_id] = it->get_id(); row[*col_no] = it->get_project_no(); row[*col_name] = it->get_project_name(); row[*col_desc] = it->get_description(); row[*col_leader_name] = it->get_project_leader_name(); row[*col_leader_surname] = it->get_project_leader_surname(); row[*col_start_date] = it->get_start_date_str_eu(); row[*col_end_date] = it->get_end_date_str_eu(); j++; } treeview->append_column(_("Number"), *col_no); treeview->append_column(_("Name"), *col_name); treeview->append_column(_("Description"), *col_desc); treeview->append_column(_("Leader name"), *col_leader_name); treeview->append_column(_("Leader surmane"), *col_leader_surname); treeview->append_column(_("Start date"), *col_start_date); treeview->append_column(_("End date"), *col_end_date); treeview->set_headers_clickable(true); treeview->set_grid_lines(Gtk::TREE_VIEW_GRID_LINES_BOTH); for(int i=0; i < 7; i++) { Gtk::TreeView::Column *pColumn = treeview->get_column(i); pColumn->set_resizable(true); pColumn->set_sort_column(i+1); } //Table for history. Gtk::TreeModel::ColumnRecord *col_record_hist = new Gtk::TreeModel::ColumnRecord(); col_id_hist = new Gtk::TreeModelColumn<time_t>(); col_no_hist = new Gtk::TreeModelColumn<std::string>(); col_desc_hist = new Gtk::TreeModelColumn<std::string>(); col_name_hist = new Gtk::TreeModelColumn<std::string>(); col_leader_name_hist = new Gtk::TreeModelColumn<std::string>(); col_leader_surname_hist = new Gtk::TreeModelColumn<std::string>(); col_start_date_hist = new Gtk::TreeModelColumn<std::string>(); col_end_date_hist = new Gtk::TreeModelColumn<std::string>(); col_record_hist->add(*col_id_hist); col_record_hist->add(*col_no_hist); col_record_hist->add(*col_name_hist); col_record_hist->add(*col_desc_hist); col_record_hist->add(*col_leader_name_hist); col_record_hist->add(*col_leader_surname_hist); col_record_hist->add(*col_start_date_hist); col_record_hist->add(*col_end_date_hist); ref_tree_model_hist = Gtk::ListStore::create(*col_record_hist); treeviewhist->set_model(ref_tree_model_hist); Gtk::TreeModel::Row row_hist; for(std::list<Project>::iterator it = hist_projects.begin(); it != hist_projects.end(); it++) { row_hist = *(ref_tree_model_hist->append()); row_hist[*col_id_hist] = it->get_id(); row_hist[*col_no_hist] = it->get_project_no(); row_hist[*col_name_hist] = it->get_project_name(); row_hist[*col_desc_hist] = it->get_description(); row_hist[*col_leader_name_hist] = it->get_project_leader_name(); row_hist[*col_leader_surname_hist] = it->get_project_leader_surname(); row_hist[*col_start_date_hist] = it->get_start_date_str_eu(); row_hist[*col_end_date_hist] = it->get_end_date_str_eu(); j++; } treeviewhist->append_column(_("Number"), *col_no_hist); treeviewhist->append_column(_("Name"), *col_name_hist); treeviewhist->append_column(_("Description"), *col_desc_hist); treeviewhist->append_column(_("Leader name"), *col_leader_name_hist); treeviewhist->append_column(_("Leader surmane"), *col_leader_surname_hist); treeviewhist->append_column(_("Start date"), *col_start_date_hist); treeviewhist->append_column(_("End date"), *col_end_date_hist); treeviewhist->set_headers_clickable(true); treeviewhist->set_grid_lines(Gtk::TREE_VIEW_GRID_LINES_BOTH); for(int i=0; i < 7; i++) { Gtk::TreeView::Column *pColumn_hist = treeviewhist->get_column(i); pColumn_hist->set_resizable(true); pColumn_hist->set_sort_column(i+1); } Gtk::HBox *const status_box = new Gtk::HBox(false, 0); Gtk::manage(status_box); active_label = new Gtk::Label(_("Number of active projects: ") + str_no_proj); late_label = new Gtk::Label(_("Number of late projects: ") + str_late_proj); history_label = new Gtk::Label(_("Number of projects in history: ") + str_history_proj); Gtk::manage(active_label); Gtk::manage(late_label); Gtk::manage(history_label); status_box->pack_start(*active_label); status_box->pack_start(*late_label); status_box->pack_start(*history_label); main_box->pack_start(*status_box, Gtk::PACK_SHRINK); show_all_children(); }
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. }
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); }
MEGroupItemInfoWidget::MEGroupItemInfoWidget() : MEAbstractItemInfoWidget("Group") { Gtk::Box* mainBox = manage(new Gtk::VBox()); // Create the groups ListStore and add to groups TreeView m_listStore = Gtk::ListStore::create(m_columns); m_treeView.set_model(m_listStore); m_treeView.append_column("Pos", m_columns.m_pos); m_treeView.append_column("Tpe", m_columns.m_tpe); m_treeView.append_column("ID", m_columns.m_ID); m_treeView.append_column("Name", m_columns.m_name); // Set column size- and resize properties. Gtk::TreeViewColumn* tmpCol; tmpCol = m_treeView.get_column(0); tmpCol->set_sizing(Gtk::TREE_VIEW_COLUMN_FIXED); tmpCol->set_fixed_width(40); tmpCol->set_resizable(true); tmpCol = m_treeView.get_column(1); tmpCol->set_sizing(Gtk::TREE_VIEW_COLUMN_FIXED); tmpCol->set_fixed_width(40); tmpCol->set_resizable(true); tmpCol = m_treeView.get_column(2); tmpCol->set_sizing(Gtk::TREE_VIEW_COLUMN_FIXED); tmpCol->set_fixed_width(70); tmpCol->set_resizable(true); // Create selection object to handle chosen rows m_selection = m_treeView.get_selection(); if (!m_selection) { mc2log << error << "No selection object created for corresponding " << "TreeView" << endl; MC2_ASSERT(false); } // Create a scrolled window to pack the TreeView widget into */ Gtk::ScrolledWindow *scrolledWindow = manage(new Gtk::ScrolledWindow()); scrolledWindow->set_policy(Gtk::POLICY_AUTOMATIC, Gtk::POLICY_ALWAYS); scrolledWindow->add(m_treeView); mainBox->pack_start(*scrolledWindow); // Add highlight + select buttons Gtk::Box* buttonBox = manage(new Gtk::HBox()); Gtk::Button* button = manage(new Gtk::Button("Highlight items in group")); button->signal_clicked().connect( sigc::mem_fun(*this, &MEGroupItemInfoWidget::highlightPressed)); buttonBox->pack_start(*button); button = manage(new Gtk::Button("Recursive")); button->signal_clicked().connect( sigc::mem_fun(*this, &MEGroupItemInfoWidget::highlightRecursivePressed)); buttonBox->pack_start(*button); button = manage(new Gtk::Button("Select")); button->signal_clicked().connect( sigc::mem_fun(*this, &MEGroupItemInfoWidget::selectItemInGroup)); buttonBox->pack_start(*button); mainBox->pack_start(*buttonBox, false, false); // Add to this frame add(*mainBox); }
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); }
MEShowNodesWindow::MEShowNodesWindow(MEMapArea* mapArea) : m_selectedRow( NULL ), m_mapArea(mapArea) { set_title("Show nodes"); set_size_request(300, 400); // Create the main-box where the frames are added. Gtk::Box* mainbox = manage(new Gtk::VBox()); Gtk::Frame* frame = NULL; //Gtk::Adjustment* adj = NULL; Gtk::Label* label = NULL; Gtk::Button* btn = NULL; m_fileSelector = manage(new Gtk::FileSelection("Select turn desc. file")); m_fileSelector->get_ok_button()->signal_clicked().connect( sigc::mem_fun(*this, &MEShowNodesWindow::on_fileSelOK)); m_fileSelector->get_cancel_button()->signal_clicked().connect( sigc::mem_fun(*this, &MEShowNodesWindow::on_fileSelCancel)); m_fileSelector->hide_fileop_buttons(); // Frame where to load file frame = manage(new Gtk::Frame("File")); Gtk::Box* box = manage(new Gtk::HBox()); m_fileNameEntry = manage(new Gtk::Entry()); box->pack_start(*m_fileNameEntry); btn = manage(new Gtk::Button("...")); btn->signal_clicked().connect( sigc::mem_fun(*this, &MEShowNodesWindow::on_selectFile)); box->pack_start(*btn, false, false); btn = manage(new Gtk::Button("Load")); btn->signal_clicked().connect( sigc::mem_fun(*this, &MEShowNodesWindow::on_loadFile)); box->pack_start(*btn, false, false); frame->add(*box); mainbox->pack_start(*frame, false, false); // Create ListStore and add to TreeView m_listStore = Gtk::ListStore::create(m_columns); m_treeView.set_model(m_listStore); m_treeView.append_column("From", m_columns.m_from); m_treeView.append_column("To", m_columns.m_to); m_treeView.append_column("Old turn", m_columns.m_oldTurn); m_treeView.append_column("Old CK", m_columns.m_oldCK); // Create selection object to handle selections m_selection = m_treeView.get_selection(); if( m_selection ) { m_selection->signal_changed().connect( sigc::mem_fun(*this, &MEShowNodesWindow::on_showNode)); } else { // If this doesn't work we're in trouble. mc2log << error << "No selection object created for corresponding " << "TreeView" << endl; MC2_ASSERT(false); } // Set column size- and resize properties. Gtk::TreeViewColumn* tmpCol; tmpCol = m_treeView.get_column( 0 ); tmpCol->set_sizing( Gtk::TREE_VIEW_COLUMN_FIXED ); tmpCol->set_fixed_width( 90 ); tmpCol->set_resizable( true ); tmpCol = m_treeView.get_column( 1 ); tmpCol->set_sizing( Gtk::TREE_VIEW_COLUMN_FIXED ); tmpCol->set_fixed_width( 90 ); tmpCol->set_resizable( true ); tmpCol = m_treeView.get_column( 2 ); tmpCol->set_sizing( Gtk::TREE_VIEW_COLUMN_FIXED ); tmpCol->set_fixed_width( 70 ); tmpCol->set_resizable( true ); tmpCol = m_treeView.get_column( 3 ); tmpCol->set_sizing( Gtk::TREE_VIEW_COLUMN_FIXED ); tmpCol->set_fixed_width( 70 ); tmpCol->set_resizable( true ); Gtk::ScrolledWindow* scrolledWin = manage(new Gtk::ScrolledWindow()); scrolledWin->set_policy(Gtk::POLICY_AUTOMATIC, Gtk::POLICY_AUTOMATIC); scrolledWin->add(m_treeView); mainbox->pack_start( *scrolledWin, true, true ); // Next and previous turn box = manage(new Gtk::HBox()); btn = manage(new Gtk::Button("Prev")); btn->signal_clicked().connect( sigc::mem_fun(*this, &MEShowNodesWindow::on_clickPrev)); box->pack_start(*btn); btn = manage(new Gtk::Button("All")); btn->signal_clicked().connect( sigc::mem_fun(*this, &MEShowNodesWindow::on_clickShowAll)); box->pack_start(*btn); btn = manage(new Gtk::Button("Next")); btn->signal_clicked().connect( sigc::mem_fun(*this, &MEShowNodesWindow::on_clickNext)); box->pack_start(*btn); mainbox->pack_start(*box, false, false); // Frame with information about the selected crossing/connection frame = manage(new Gtk::Frame("Selected crossing")); Gtk::HBox* hbox = manage(new Gtk::HBox()); box = manage(new Gtk::VBox()); label = manage(new Gtk::Label("Current values")); label->set_pattern( "______________"); box->pack_start(*label); m_curTurnDesc = manage(new Gtk::Label("")); box->pack_start(*m_curTurnDesc); m_curCrossingKind = manage(new Gtk::Label("")); box->pack_start(*m_curCrossingKind); hbox->pack_start(*box); box = manage(new Gtk::VBox()); label = manage(new Gtk::Label("Old values")); label->set_pattern( "__________"); box->pack_start(*label); m_oldTurnDesc = manage(new Gtk::Label("")); box->pack_start(*m_oldTurnDesc); m_oldCrossingKind = manage(new Gtk::Label("")); box->pack_start(*m_oldCrossingKind); hbox->pack_start(*box); frame->add(*hbox); mainbox->pack_start(*frame, false, false); add(*mainbox); show_all(); }
Frame_FilesTab::Frame_FilesTab() { this->set_shadow_type(Gtk::SHADOW_IN); this->set_margin_top(5); this->set_margin_left(5); this->set_margin_right(5); this->set_margin_bottom(5); Gtk::ScrolledWindow *ScrolledWindow = Gtk::manage(new Gtk::ScrolledWindow); ScrolledWindow->set_policy(Gtk::POLICY_AUTOMATIC, Gtk::POLICY_AUTOMATIC); this->add(*ScrolledWindow); Gtk::TreeView *tvFiles = Gtk::manage(new Gtk::TreeView); tvFiles->set_grid_lines(Gtk::TREE_VIEW_GRID_LINES_BOTH); ScrolledWindow->add(*tvFiles); refTreeModel = Gtk::ListStore::create(FilesColumns); tvFiles->set_model(refTreeModel); tvFiles->append_column("Name", FilesColumns.Name); Gtk::CellRendererText *cellrenderer_FileType = Gtk::manage(new Gtk::CellRendererText); Gtk::TreeView::Column *tvFiles_FileType = Gtk::manage(new Gtk::TreeView::Column); tvFiles_FileType->set_title("Type"); //tvFiles_FileType->set_resizable(true); tvFiles_FileType->pack_start(*cellrenderer_FileType); tvFiles_FileType->set_cell_data_func(*cellrenderer_FileType, sigc::mem_fun(*this, &Frame_FilesTab::treeviewcolumn_filetype)); tvFiles->append_column(*tvFiles_FileType); Gtk::CellRendererText *cellrenderer_FileSize = Gtk::manage(new Gtk::CellRendererText); Gtk::TreeView::Column *tvFiles_FileSize = Gtk::manage(new Gtk::TreeView::Column); tvFiles_FileSize->set_title("Type"); //tvFiles_FileSize->set_resizable(true); tvFiles_FileSize->pack_start(*cellrenderer_FileSize); tvFiles_FileSize->set_cell_data_func(*cellrenderer_FileSize, sigc::mem_fun(*this, &Frame_FilesTab::treeviewcolumn_filesize)); tvFiles->append_column(*tvFiles_FileSize); Gtk::CellRendererProgress *cellrenderer_FileProgress = Gtk::manage(new Gtk::CellRendererProgress); Gtk::TreeView::Column *tvFiles_FileProgress = Gtk::manage(new Gtk::TreeView::Column); tvFiles_FileProgress->set_title("Progress"); //tvFiles_FileProgress->set_resizable(true); tvFiles_FileProgress->pack_start(*cellrenderer_FileProgress); tvFiles_FileProgress->set_cell_data_func(*cellrenderer_FileProgress, sigc::mem_fun(*this, &Frame_FilesTab::treeviewcolumn_fileprogress)); tvFiles->append_column(*tvFiles_FileProgress); Gtk::CellRendererText *cellrenderer_FilePriority = Gtk::manage(new Gtk::CellRendererText); Gtk::TreeView::Column *tvFiles_FilePriority = Gtk::manage(new Gtk::TreeView::Column); tvFiles_FilePriority->set_title("Priority"); //tvFiles_FilePriority->set_resizable(true); tvFiles_FilePriority->pack_start(*cellrenderer_FilePriority); tvFiles_FilePriority->set_cell_data_func(*cellrenderer_FilePriority, sigc::mem_fun(*this, &Frame_FilesTab::treeviewcolumn_filepriority)); tvFiles->append_column(*tvFiles_FilePriority); // TODO: REMOVE TEST DATA BELOW Gtk::TreeModel::Row row = *(refTreeModel->append()); row[FilesColumns.Name] = "File Name.Mp4"; row[FilesColumns.Size] = (1024 * 1024) *1023 + 5504; row[FilesColumns.Progress] = 75; row[FilesColumns.Priority] = 2; }
ModelFctDetailViewImpl::ModelFctDetailViewImpl(ModelFctDetailColumns& Columns) : m_Columns(Columns) { mp_Notebook = Gtk::manage(new Gtk::Notebook()); mp_InfoPage = new ModelFctDetailInfoPage(); mp_ParamsTreeView = Gtk::manage(new Gtk::TreeView()); mp_ParamsTreeView->append_column(_("Name"), m_Columns.m_Name); mp_ParamsTreeView->append_column(_("SI Unit"), m_Columns.m_Unit); mp_ParamsTreeView->append_column(_("Description"), m_Columns.m_Description); mp_ParamsTreeView->set_visible(true); mp_VarsTreeView = Gtk::manage(new Gtk::TreeView()); mp_VarsTreeView->append_column(_("Name"), m_Columns.m_Name); mp_VarsTreeView->append_column(_("Type"), m_Columns.m_Type); mp_VarsTreeView->append_column(_("SI Unit"), m_Columns.m_Unit); mp_VarsTreeView->append_column(_("Unit class"), m_Columns.m_Class); mp_VarsTreeView->append_column(_("Description"), m_Columns.m_Description); mp_VarsTreeView->set_visible(true); mp_IDataTreeView = Gtk::manage(new Gtk::TreeView()); mp_IDataTreeView->append_column(_("Name"), m_Columns.m_Name); mp_IDataTreeView->append_column(_("Unit class"), m_Columns.m_Class); mp_IDataTreeView->set_visible(true); mp_EventsTreeView = Gtk::manage(new Gtk::TreeView()); mp_EventsTreeView->append_column(_("Unit class"), m_Columns.m_Class); mp_EventsTreeView->set_visible(true); mp_ExtraFilesTreeView = Gtk::manage(new Gtk::TreeView()); mp_ExtraFilesTreeView->append_column(_("Name"), m_Columns.m_Name); mp_ExtraFilesTreeView->set_visible(true); Gtk::ScrolledWindow* ParamsWin = Gtk::manage(new Gtk::ScrolledWindow()); ParamsWin->set_policy(Gtk::POLICY_AUTOMATIC, Gtk::POLICY_AUTOMATIC); ParamsWin->set_visible(true); ParamsWin->add(*mp_ParamsTreeView); Gtk::ScrolledWindow* VarsWin = Gtk::manage(new Gtk::ScrolledWindow()); VarsWin->set_policy(Gtk::POLICY_AUTOMATIC, Gtk::POLICY_AUTOMATIC); VarsWin->set_visible(true); VarsWin->add(*mp_VarsTreeView); Gtk::ScrolledWindow* IDataWin = Gtk::manage(new Gtk::ScrolledWindow()); IDataWin->set_policy(Gtk::POLICY_AUTOMATIC, Gtk::POLICY_AUTOMATIC); IDataWin->set_visible(true); IDataWin->add(*mp_IDataTreeView); Gtk::ScrolledWindow* EventsWin = Gtk::manage(new Gtk::ScrolledWindow()); EventsWin->set_policy(Gtk::POLICY_AUTOMATIC, Gtk::POLICY_AUTOMATIC); EventsWin->set_visible(true); EventsWin->add(*mp_EventsTreeView); Gtk::ScrolledWindow* ExtraFilesWin = Gtk::manage(new Gtk::ScrolledWindow()); ExtraFilesWin->set_policy(Gtk::POLICY_AUTOMATIC, Gtk::POLICY_AUTOMATIC); ExtraFilesWin->set_visible(true); ExtraFilesWin->add(*mp_ExtraFilesTreeView); mp_Notebook->append_page(*mp_InfoPage->asWidget(), _("Information")); mp_Notebook->append_page(*ParamsWin, _("Parameters")); mp_Notebook->append_page(*VarsWin, _("Variables")); mp_Notebook->append_page(*IDataWin, _("Inputdata")); mp_Notebook->append_page(*EventsWin, _("Events")); mp_Notebook->append_page(*ExtraFilesWin, _("Extra Files")); mp_Notebook->set_visible(true); }
int sourceview___::proc__(deque<ustring>* p,char*buf,long siz,char**addr_ret,void*shangji,void*ce) { char sdz=0; if((*p)[0]==name__()){ if(siz==-1)return 1; sdz='s'; }else return 0; if(p->size()<=2){ d_(sh_,err_show_buzu_,p); return 1; } switch(sdz){ case's': { SourceView* sv=NULL; char sdz1=0; const ustring& p1=(*p)[1]; if(p1=="撤销") sdz1='u'; else if(p1=="重做") sdz1='r'; else if(p1=="撤销不记始") sdz1='B'; else if(p1=="撤销不记终") sdz1='E'; else if(p1=="语法高亮") sdz1='h'; #ifdef ver_all_ else if(p1=="剪切") sdz1='x'; else if(p1=="复制") sdz1='c'; else if(p1=="粘贴") sdz1='v'; else if(p1=="已修改") sdz1='m'; else if(p1=="内容") sdz1=' '; else if(p1=="打开文件") sdz1='o'; else if(p1=="保存文件") sdz1='s'; else if(p1=="焦点") sdz1='.'; else if(p1=="不可编辑") sdz1='e'; else if(p1=="光标位置") sdz1='p'; else if(p1=="光标行列") sdz1='l'; else if(p1=="插入") return insert__(p,1); #endif else{ switch(sdz){ case's': { Gtk::ScrolledWindow* sw; sh_->builder_->get_widget((*p)[2], sw); if(!sw){ d_(sh_,err_show_wufa_,2,p,2); return 1; } sv=Gtk::manage(new SourceView()); sv->set_show_line_numbers(true); sv->set_auto_indent (true); sv->set_tab_width(4); //GTK_SOURCE_SMART_HOME_END_ALWAYS sv->set_smart_home_end((SourceSmartHomeEndType)2); sv->set_can_focus(true); names_[p1]=sv; sw->add(*sv); sw->show_all_children (); return 1; } } } sv=tv__(p,2); if(!sv) return 1; RefPtr < SourceBuffer > sb=sv->get_source_buffer(); switch(sdz1){ #ifdef ver_all_ case'x': case'c': case'v': { RefPtr<Gtk::Clipboard> cb = Gtk::Clipboard::get(); switch(sdz1){ case'x': sb->cut_clipboard(cb); break; case'c': sb->copy_clipboard(cb); break; case'v': sb->paste_clipboard(cb); break; } break; } case'm': if(p->size()>3){ const ustring&s=(*p)[3]; if(s=="侦听"){ control___* ctl=Gtk::manage(new control___(sh_,d_,(*p)[0],(*p)[2],p1)); if(p->size()>4) ctl->code__((*p)[4]); sb->signal_modified_changed().connect(sigc::mem_fun(*ctl,&control___::modified_changed__),false); }else sb->set_modified(d_(sh_,bool_,s.c_str())); }else l2s__(sb->get_modified(),buf); break; case' ': if(p->size()>3) sb->set_text((*p)[3]); else *addr_ret=dup__(sb->get_text().c_str()); break; case'o': if(p->size()>3){ ustring s; file_get__((*p)[3].c_str(),s); sb->set_text(s); } break; case's': if(p->size()>3){ GError *error = NULL; g_file_set_contents ((*p)[3].c_str(), sb->get_text().c_str(), -1, &error); if (error != NULL) { cpy__(buf,error->message,siz); g_clear_error(&error); } } break; case'.': sv->grab_focus(); break; case'e': if(p->size()>3) sv->set_editable(d_(sh_,bool_,(*p)[3].c_str())); else sv->set_editable(false); break; case'p': case'l': { Gtk::TextIter ti=sb->get_iter_at_mark(sb->get_mark("insert")); if(sdz1=='l'){ if(p->size()<=3) sprintf(buf,"%d,%d,",ti.get_line (),ti.get_line_offset ()); else{ int line_offset=ti.get_line_offset (); if(p->size()>3) ti.set_line (s2i_plus__((*p)[3],ti.get_line ())); if(p->size()>4) ti.set_line_offset (s2i_plus__((*p)[4],line_offset)); //sb->place_cursor(ti); scroll2__(sv,ti); } }else{ if(p->size()>3){ ti.set_offset (s2i_plus__((*p)[3],ti.get_offset ())); //sb->place_cursor(ti); scroll2__(sv,ti); }else l2s__(ti.get_offset (),buf); } break; } #endif case'u': if(sb->can_undo()) sb->undo(); break; case'r': if(sb->can_redo()) sb->redo(); break; case'B': sb->begin_not_undoable_action(); break; case'E': sb->end_not_undoable_action(); break; case'h': if(p->size()>3){ RefPtr<SourceLanguageManager> slm=SourceLanguageManager::get_default(); RefPtr<SourceLanguage> sl=slm->get_language((*p)[3]); if(sl){ sb->set_language(sl); sb->set_highlight_syntax(true); break; } } sb->set_highlight_syntax(false); break; } break; } } return 1; }
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(); }
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(); }