PaletteWindow::PaletteWindow () : Gtk::Window() { this->set_title("Meteor - Palette"); this->set_resizable(false); m_bgPalette.set_size_request(161, 161); m_objPalette.set_size_request(161, 161); Gtk::Frame* bgframe = manage(new Gtk::Frame("BG palette")); bgframe->add(m_bgPalette); Gtk::Frame* objframe = manage(new Gtk::Frame("OBJ palette")); objframe->add(m_objPalette); Gtk::HBox* mainhbox = manage(new Gtk::HBox); mainhbox->pack_start(*bgframe); mainhbox->pack_start(*objframe); this->add(*mainhbox); m_bgPalette.signal_expose_event().connect(sigc::mem_fun(*this, &PaletteWindow::on_bg_expose)); m_objPalette.signal_expose_event().connect(sigc::mem_fun(*this, &PaletteWindow::on_obj_expose)); m_vblank_conn = AMeteor::_lcd.sig_vblank.connect(syg::mem_fun(*this, &PaletteWindow::on_vblank)); }
Gtk::Widget * Widget_RendDesc::create_other_tab() { Gtk::Alignment *paddedPanel = manage(new Gtk::Alignment(0, 0, 1, 1)); paddedPanel->set_padding(12, 12, 12, 12); Gtk::Box *panelBox = manage(new Gtk::Box(Gtk::ORIENTATION_VERTICAL, 12)); panelBox->set_homogeneous(false); paddedPanel->add(*panelBox); Gtk::Frame *lockFrame = manage(new Gtk::Frame(_("Locks and Links"))); lockFrame->set_shadow_type(Gtk::SHADOW_NONE); ((Gtk::Label *) lockFrame->get_label_widget())->set_markup(_("<b>Locks and Links</b>")); panelBox->pack_start(*lockFrame, Gtk::PACK_SHRINK); Gtk::Alignment *lockPadding = manage(new Gtk::Alignment(0, 0, 1, 1)); lockPadding->set_padding(6, 0, 24, 0); lockFrame->add(*lockPadding); Gtk::Grid *lockGrid = manage(new Gtk::Grid()); lockGrid->set_row_spacing(6); lockGrid->set_column_spacing(12); lockPadding->add(*lockGrid); lockGrid->attach(*toggle_im_width, 0, 0, 1, 1); toggle_im_width->set_hexpand(true); lockGrid->attach(*toggle_im_height, 1, 0, 1, 1); toggle_im_height->set_hexpand(true); lockGrid->attach(*toggle_im_aspect, 2, 0, 1, 1); toggle_im_aspect->set_hexpand(true); lockGrid->attach(*toggle_im_span, 3, 0, 1, 1); toggle_im_span->set_hexpand(true); lockGrid->attach(*toggle_px_width, 0, 1, 1, 1); lockGrid->attach(*toggle_px_height, 1, 1, 1, 1); lockGrid->attach(*toggle_px_aspect, 2, 1, 1, 1); Gtk::Frame *focusFrame = manage(new Gtk::Frame(_("Focus Point"))); focusFrame->set_shadow_type(Gtk::SHADOW_NONE); ((Gtk::Label *) focusFrame->get_label_widget())->set_markup(_("<b>Focus Point</b>")); panelBox->pack_start(*focusFrame, Gtk::PACK_SHRINK); Gtk::Alignment *focusPadding = manage(new Gtk::Alignment(0, 0, 1, 1)); focusPadding->set_padding(6, 0, 24, 0); focusFrame->add(*focusPadding); Gtk::Box *focusBox = manage(new Gtk::Box(Gtk::ORIENTATION_HORIZONTAL, 12)); focusPadding->add(*focusBox); Gtk::Label *focusLabel = manage(new Gtk::Label(_("_Focus Point"), 0, 0.5, true)); focusLabel->set_mnemonic_widget(*entry_focus); focusBox->pack_start(*focusLabel, Gtk::PACK_SHRINK); focusBox->pack_start(*entry_focus, Gtk::PACK_EXPAND_WIDGET); paddedPanel->show_all(); return paddedPanel; }
SelectDialog::SelectDialog ( ButtonID buttons, const char* title, const char* message, bool needSelection ) : DialogBox(buttons, title) , sw_(0) , list_(0) , selectBtn_(0) , deselectBtn_(0) , needSelection_(needSelection) { get_vbox()->set_border_width(2); if (message) { Gtk::Box* hbox = manage(new Gtk::HBox); get_vbox()->pack_start(*hbox, false, false); Gtk::Frame* frame = manage(new Gtk::Frame); hbox->pack_start(*frame); hbox->set_border_width(3); Gtk::Label* label = manage(new Gtk::Label(message, .0)); frame->add(*label); label->set_padding(3, 5); Gtk_set_size(label, 570, -1); label->set_justify(Gtk_FLAG(JUSTIFY_LEFT)); label->set_line_wrap(true); } sw_ = manage(new Gtk::ScrolledWindow); get_vbox()->pack_start(*sw_); sw_->set_policy(Gtk_FLAG(POLICY_AUTOMATIC), Gtk_FLAG(POLICY_AUTOMATIC)); Gtk_set_size(sw_, 580, 300); list_ = manage(new Gtk::List); Gtk_add_with_viewport(sw_, *list_); list_->set_selection_mode(Gtk_FLAG(SELECTION_MULTIPLE)); add_select_button("Select _All", true); add_select_button("_Deselect All", false); Gtk_set_resizable(this, true); if (needSelection) { if (Gtk::Button* btn = get_ok_button()) { btn->set_sensitive(false); } } selConn_ = Gtk_CONNECT_0(list_, selection_changed, this, &SelectDialog::on_selection_changed); get_vbox()->show_all(); }
DlgDownload::DlgDownload(){ add_button (Gtk::Stock::OK, Gtk::RESPONSE_OK); add_button (Gtk::Stock::CANCEL, Gtk::RESPONSE_CANCEL); signal_response().connect( sigc::hide(sigc::mem_fun(this, &DlgDownload::hide_all))); cb_w = manage(new Gtk::CheckButton("Waypoints")); cb_a = manage(new Gtk::CheckButton("Active log")); cb_o = manage(new Gtk::CheckButton("Saved tracks")); Gtk::VButtonBox * bbox = manage(new Gtk::VButtonBox); bbox->add(*cb_w); bbox->add(*cb_a); bbox->add(*cb_o); Gtk::Frame * frame = manage(new Gtk::Frame("Select data to be downloaded:")); frame->add(*bbox); Gtk::Label * l_dev = manage(new Gtk::Label("GPS device:", Gtk::ALIGN_RIGHT)); e_dev = manage(new Gtk::Entry); cb_off = manage(new Gtk::CheckButton("Turn off device after download")); Gtk::Table * table = manage(new Gtk::Table(2,3)); table->attach(*frame, 0,2, 0,1, Gtk::FILL, Gtk::SHRINK, 3,3); table->attach(*l_dev, 0,1, 1,2, Gtk::SHRINK, Gtk::SHRINK, 3,3); table->attach(*e_dev, 1,2, 1,2, Gtk::EXPAND|Gtk::FILL, Gtk::SHRINK, 3,3); table->attach(*cb_off, 0,2, 2,3, Gtk::FILL, Gtk::SHRINK, 3,3); get_vbox()->add(*table); }
Gtk::VBox * Extension::get_info_widget(void) { Gtk::VBox * retval = Gtk::manage(new Gtk::VBox()); Gtk::Frame * info = Gtk::manage(new Gtk::Frame("General Extension Information")); retval->pack_start(*info, true, true, 5); #if WITH_GTKMM_3_0 Gtk::Grid * table = Gtk::manage(new Gtk::Grid()); #else Gtk::Table * table = Gtk::manage(new Gtk::Table()); #endif info->add(*table); int row = 0; add_val(_("Name:"), _(name), table, &row); add_val(_("ID:"), id, table, &row); add_val(_("State:"), _state == STATE_LOADED ? _("Loaded") : _state == STATE_UNLOADED ? _("Unloaded") : _("Deactivated"), table, &row); retval->show_all(); return retval; }
void InitWindow::FillMainBox() { Gtk::VBox* vbox = get_vbox(); Gtk::HBox* hbox = Gtk::manage( new Gtk::HBox ); // Add table editor // Gtk::Frame* charFrame = Gtk::manage( new Gtk::Frame( gettext("Characters") ) ); // charFrame->add( f_charTable ); // hbox->pack_start( *charFrame ); Gtk::Frame* monsterFrame = Gtk::manage( new Gtk::Frame( gettext("Monsters") ) ); // monsterFrame->add( f_monsterTable ); // hbox->pack_start( *monsterFrame ); vbox->pack_start( *hbox ); const bool alternative_order = alternative_button_order( Glib::RefPtr<const Gdk::Screen>(0) ); // if( alternative_order ) { // Windows order, OK on the left, Cancel on the right f_acceptButton = add_button( Gtk::Stock::APPLY , Gtk::RESPONSE_OK ); } // if( f_allowCancel ) { f_cancelButton = add_button( Gtk::Stock::CANCEL, Gtk::RESPONSE_CANCEL ); } else { f_resetButton = add_button( Gtk::Stock::REVERT_TO_SAVED, Gtk::RESPONSE_REJECT ); } // if( !alternative_order ) { // Other order like Gnome2 or MacOS // f_acceptButton = add_button( Gtk::Stock::APPLY , Gtk::RESPONSE_OK ); } show_all_children(); }
NameModule::NameModule( bool has_widget ) : AMonitorModule('n', has_widget) { if (this->_has_widget) { this->_box = new Gtk::Box(Gtk::ORIENTATION_HORIZONTAL, 5); this->_hostname_label = Gtk::manage(new Gtk::Label("INITIAL HOSTNAME")); this->_hostname_label->set_padding(5, 3); Gtk::Frame* frame; // Host frame = Gtk::manage(new Gtk::Frame("Host Name")); try { dynamic_cast<Gtk::Label*>(frame->get_label_widget())->set_markup("<b>Host Name</b>"); } catch(std::exception) {} frame->add(*this->_hostname_label); this->_box->pack_start(*frame); // User this->_username_label = Gtk::manage(new Gtk::Label("INITIAL USERNAME")); this->_username_label->set_padding(5, 3); frame = Gtk::manage(new Gtk::Frame("Username")); try { dynamic_cast<Gtk::Label*>(frame->get_label_widget())->set_markup("<b>Username</b>"); } catch(std::exception) {} frame->add(*this->_username_label); this->_box->pack_start(*frame); this->refresh(); } }
OsInfoModule::OsInfoModule( bool has_widget ) : AMonitorModule('o', has_widget) { if (this->_has_widget) { this->_box = new Gtk::Box(Gtk::ORIENTATION_HORIZONTAL, 5); this->_osinfo_label = Gtk::manage(new Gtk::Label("OSINFO")); this->_osinfo_label->set_padding(5, 3); Gtk::Frame* frame; frame = Gtk::manage(new Gtk::Frame("OS Info")); try { dynamic_cast<Gtk::Label*>(frame->get_label_widget())->set_markup("<b>OS Info</b>"); } catch(std::exception) {} frame->add(*this->_osinfo_label); this->_box->pack_start(*frame); this->refresh(); } }
MapViewAddLayersDialog::MapViewAddLayersDialog() { mp_Dialog = new Gtk::Dialog(_("Displaying resources in MapView")); mref_TreeModel = Gtk::ListStore::create(m_Columns); mp_TreeView = Gtk::manage(new Gtk::TreeView(mref_TreeModel)); mp_TreeView->append_column(_("Data type"), m_Columns.m_Type); mp_TreeView->get_column(0)->set_sort_column(m_Columns.m_Type); mp_TreeView->append_column(_("Data ID"), m_Columns.m_Id); mp_TreeView->get_column(1)->set_sort_column(m_Columns.m_Id); mp_TreeView->append_column(_("Unit Class"), m_Columns.m_Class); mp_TreeView->get_column(2)->set_sort_column(m_Columns.m_Class); mp_TreeView->append_column(_("Data source path"), m_Columns.m_Path); mp_TreeView->get_column(3)->set_sort_column(m_Columns.m_Path); mp_TreeView->get_selection()->set_mode(Gtk::SELECTION_MULTIPLE); mp_TreeView->expand_all(); mp_ScrolledWin = Gtk::manage(new Gtk::ScrolledWindow()); mp_ScrolledWin->set_policy(Gtk::POLICY_AUTOMATIC, Gtk::POLICY_AUTOMATIC); mp_ScrolledWin->add(*mp_TreeView); Gtk::Frame* MainFrame = Gtk::manage(new Gtk::Frame()); MainFrame->set_shadow_type(Gtk::SHADOW_IN); MainFrame->set_border_width(5); MainFrame->set_visible(true); MainFrame->add(*mp_ScrolledWin); Gtk::Label* TheLabel = Gtk::manage(new Gtk::Label( _("Choose resources to display:"), 0, 0.5)); TheLabel->set_padding(0,5); mp_Dialog->get_vbox()->pack_start(*TheLabel, Gtk::PACK_SHRINK); mp_Dialog->get_vbox()->pack_start(*MainFrame); mp_Dialog->add_button(Gtk::Stock::CANCEL, Gtk::RESPONSE_CANCEL); mp_Dialog->add_button(Gtk::Stock::OK, Gtk::RESPONSE_OK); mp_Dialog->set_default_response(Gtk::RESPONSE_OK); mp_Dialog->set_default_size(500, 300); mp_Dialog->show_all_children(); }
void SettingsWindow::FillMainBox() { InitTable(); InitTreeView(); Gtk::VBox* vbox = get_vbox(); Gtk::Frame* frame; Gtk::VBox* frame_vbox; frame = Gtk::manage(new Gtk::Frame(gettext("Misc Options"))); frame->add( f_table ); frame_vbox = Gtk::manage(new Gtk::VBox); frame_vbox->pack_start( *frame, true, true ); vbox->pack_start( *frame_vbox, true, true ); // frame = Gtk::manage(new Gtk::Frame(gettext("Settings"))); frame->add( f_treeView ); frame_vbox = Gtk::manage(new Gtk::VBox); frame_vbox->pack_start( *frame, true, true ); vbox->pack_start( *frame_vbox, true, true ); show_all_children(); }
PanelMundo::PanelMundo() { pathFileMundos = RUTA_CARPETA_MUNDOS; pathFileMundos += "mundos.xml"; set_size_request(ANCHO_WIZARD, ALTO_WIZARD); cargarNombreMundos(); // Widgets con funcionalidad botonEditar = new Gtk::Button("Editar mundo seleccionado"); botonCrear = new Gtk::Button("Crear mundo nuevo"); selector = new SelectorMundos(nombreMundos); creador = new CreadorMundo(nombreMundos); // Contenedores Gtk::VBox* cajaVertical = manage(new Gtk::VBox(true, 30)); Gtk::HBox* cajaHorizontalUno = manage(new Gtk::HBox(false, 20)); Gtk::HBox* cajaHorizontalDos = manage(new Gtk::HBox(false, 20)); Gtk::Frame* cuadroEditar = manage(new Gtk::Frame("Edite un mundo existente")); Gtk::Frame* cuadroCrear = manage(new Gtk::Frame("Cree un mundo nuevo")); cajaHorizontalUno->pack_start(*selector); Gtk::HButtonBox* cajaAuxiliarUno = manage(new Gtk::HButtonBox()); cajaAuxiliarUno->set_layout(Gtk::BUTTONBOX_CENTER); cajaAuxiliarUno->pack_start(*botonEditar, Gtk::PACK_SHRINK); cajaHorizontalUno->pack_start(*cajaAuxiliarUno, Gtk::PACK_SHRINK); cajaHorizontalDos->pack_start(*creador); Gtk::HButtonBox* cajaAuxiliarDos = manage(new Gtk::HButtonBox()); cajaAuxiliarDos->set_layout(Gtk::BUTTONBOX_CENTER); cajaAuxiliarDos->pack_start(*botonCrear, Gtk::PACK_SHRINK); cajaHorizontalDos->pack_start(*cajaAuxiliarDos, Gtk::PACK_SHRINK); cuadroEditar->add(*cajaHorizontalUno); cuadroCrear->add(*cajaHorizontalDos); cajaVertical->pack_start(*cuadroEditar); cajaVertical->pack_start(*cuadroCrear); add(*cajaVertical); // Seniales botonEditar->signal_clicked().connect(sigc::mem_fun(*this, &PanelMundo::botonEditarClickeado)); botonCrear->signal_clicked().connect(sigc::mem_fun(*this, &PanelMundo::botonCrearClickeado)); }
VizTab::VizTab(const Graph& g, const string& name) : pGraph(new Graph(g)) { Gtk::Notebook* notebook = TheBuilder::get<Gtk::Notebook>("viz_tabs"); Gtk::Frame* tabFrame = Gtk::manage(new Gtk::Frame); fpCanvas = Gtk::manage(new VizCanvas(pGraph.get(), this)); notebook->append_page(*tabFrame, name); tabFrame->add(*fpCanvas); tabFrame->show_all(); notebook->set_current_page(-1); Gtk::Button* compareBtn = TheBuilder::get<Gtk::Button>("viz_compare_button"); compareBtn->signal_clicked().connect(sigc::mem_fun(*this, &VizTab::displayComparisonDialog)); }
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; }
studio::Dialog_SoundSelect::Dialog_SoundSelect(Gtk::Window &parent, etl::handle<synfigapp::CanvasInterface> ci) :Dialog(_("Sound Select"), parent), canvas_interface(ci) { Gtk::Alignment *dialogPadding = manage(new Gtk::Alignment(0, 0, 1, 1)); dialogPadding->set_padding(12, 12, 12, 12); get_vbox()->pack_start(*dialogPadding, false, false, 0); Gtk::Frame *soundFrame = manage(new Gtk::Frame(_("Sound Parameters"))); ((Gtk::Label *) soundFrame->get_label_widget())->set_markup(_("<b>Sound Parameters</b>")); soundFrame->set_shadow_type(Gtk::SHADOW_NONE); dialogPadding->add(*soundFrame); Gtk::Alignment *framePadding = manage(new Gtk::Alignment(0, 0, 1, 1)); framePadding->set_padding(6, 0, 24, 0); soundFrame->add(*framePadding); Gtk::Label *fileLabel = manage(new Gtk::Label(_("_Sound File"), true)); fileLabel->set_alignment(0, 0.5); fileLabel->set_mnemonic_widget(soundfile); Gtk::Label *offsetLabel = manage(new Gtk::Label(_("Time _Offset"), true)); offsetLabel->set_alignment(0, 0.5); offsetLabel->set_mnemonic_widget(offset); Gtk::Table *table = manage(new Gtk::Table(2, 2, false)); table->set_row_spacings(6); table->set_col_spacings(12); framePadding->add(*table); table->attach(*fileLabel, 0, 1, 0, 1, Gtk::SHRINK | Gtk::FILL, Gtk::SHRINK | Gtk::FILL, 0, 0); table->attach(soundfile, 1, 2, 0, 1, Gtk::EXPAND | Gtk::FILL, Gtk::SHRINK | Gtk::FILL, 0, 0); table->attach(*offsetLabel, 0, 1, 1, 2, Gtk::SHRINK | Gtk::FILL, Gtk::SHRINK | Gtk::FILL, 0, 0); table->attach(offset, 1, 2, 1, 2, Gtk::EXPAND | Gtk::FILL, Gtk::SHRINK | Gtk::FILL, 0, 0); okbutton = manage(new Gtk::Button(Gtk::StockID("gtk-ok"))); add_action_widget(*okbutton, 0); get_vbox()->show_all(); offset.set_value(0); okbutton->signal_clicked().connect(sigc::mem_fun(*this,&Dialog_SoundSelect::on_ok)); }
Example_ScrolledViewport::Example_ScrolledViewport() { Gtk::HBox* hbox; Gtk::VBox* vbox; set_title("ScrolledViewport Example"); Papyrus::Gtk::Viewport& viewport = m_ScrolledViewport.viewport(); m_Zoomer = Papyrus::Zoomer::create( ); viewport.add_controller( m_Zoomer ); viewport.set_size_request( 300, 200 ); // Create some shapes to add to the group Papyrus::Group::pointer g = Papyrus::example_group( ); viewport.canvas()->add( g ); m_Zoomer->add( g ); vbox = Gtk::manage( new Gtk::VBox() ); vbox->pack_start( m_ScrolledViewport ); vbox->pack_start( *Gtk::manage( new Gtk::HSeparator() ) ); Gtk::RadioButton* rb; Gtk::VBox* vbox2; Gtk::Frame* frame; Gtk::Label* label; label = Gtk::manage( new Gtk::Label("Use the mouse wheel to zoom in and out.\n\nThe scrollbars are set to automatic in this example so you will need to zoom in before they show up.") ); label->set_use_markup(); label->set_line_wrap(); vbox->pack_start(*label, Gtk::PACK_SHRINK, 10); vbox->pack_start( *Gtk::manage( new Gtk::HSeparator() ) ); vbox2 = Gtk::manage( new Gtk::VBox() ); frame = Gtk::manage( new Gtk::Frame("Viewport Scroll Placement") ); frame->add(*vbox2); vbox->pack_start(*frame, Gtk::PACK_SHRINK, 10); label = Gtk::manage( new Gtk::Label("<i>Placement refers to the corner where the viewport will be placed</i>") ); label->set_use_markup(); label->set_line_wrap(); vbox2->pack_start(*label, Gtk::PACK_SHRINK); Gtk::RadioButtonGroup scroll_placement_group; rb = Gtk::manage( new Gtk::RadioButton( scroll_placement_group, "Top Left" ) ); rb->signal_toggled().connect( sigc::bind(sigc::mem_fun(*this, &Example_ScrolledViewport::on_scroll_placement_changed), Gtk::CORNER_TOP_LEFT) ); vbox2->pack_start( *rb ); rb = Gtk::manage( new Gtk::RadioButton( scroll_placement_group, "Bottom Left" ) ); rb->signal_toggled().connect( sigc::bind(sigc::mem_fun(*this, &Example_ScrolledViewport::on_scroll_placement_changed), Gtk::CORNER_BOTTOM_LEFT) ); vbox2->pack_start( *rb ); rb = Gtk::manage( new Gtk::RadioButton( scroll_placement_group, "Top Right" ) ); rb->signal_toggled().connect( sigc::bind(sigc::mem_fun(*this, &Example_ScrolledViewport::on_scroll_placement_changed), Gtk::CORNER_TOP_RIGHT) ); vbox2->pack_start( *rb ); rb = Gtk::manage( new Gtk::RadioButton( scroll_placement_group, "Bottom Right" ) ); rb->signal_toggled().connect( sigc::bind(sigc::mem_fun(*this, &Example_ScrolledViewport::on_scroll_placement_changed), Gtk::CORNER_BOTTOM_RIGHT) ); vbox2->pack_start( *rb ); this->add( *vbox ); show_all(); }
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. }
//dialog_previewoptions stuff Dialog_PreviewOptions::Dialog_PreviewOptions() :Dialog(_("Preview Options")), adj_zoom(Gtk::Adjustment::create(0.5,0.1,5.0,0.1,0.2)), adj_fps(Gtk::Adjustment::create(12,1,120,1,5)), check_overbegin(_("_Begin time"),false), check_overend(_("_End time"),false), settings(this,"prevoptions") { //framerate = 15.0f; //zoom = 0.2f; //set the fps of the time widgets Gtk::Alignment *dialogPadding = manage(new Gtk::Alignment(0, 0, 1, 1)); dialogPadding->set_padding(12, 12, 12, 12); get_vbox()->add(*dialogPadding); Gtk::VBox *dialogBox = manage(new Gtk::VBox(false, 12)); dialogPadding->add(*dialogBox); Gtk::Frame *generalFrame = manage(new Gtk::Frame(_("General settings"))); generalFrame->set_shadow_type(Gtk::SHADOW_NONE); ((Gtk::Label *) generalFrame->get_label_widget())->set_markup(_("<b>General settings</b>")); dialogBox->pack_start(*generalFrame, false, false, 0); Gtk::Alignment *generalPadding = manage(new Gtk::Alignment(0, 0, 1, 1)); generalPadding->set_padding(6, 0, 24, 0); generalFrame->add(*generalPadding); Gtk::Table *generalTable = manage(new Gtk::Table(2, 2, false)); generalTable->set_row_spacings(6); generalTable->set_col_spacings(12); generalPadding->add(*generalTable); Gtk::Label *zoomLabel = manage(new Gtk::Label(_("_Quality"))); zoomLabel->set_alignment(0, 0.5); zoomLabel->set_use_underline(TRUE); Gtk::SpinButton *zoomSpinner = manage(new Gtk::SpinButton(adj_zoom, 0.1, 2)); zoomLabel->set_mnemonic_widget(*zoomSpinner); zoomSpinner->set_alignment(1); generalTable->attach(*zoomLabel, 0, 1, 0, 1, Gtk::SHRINK | Gtk::FILL, Gtk::EXPAND | Gtk::FILL, 0, 0); generalTable->attach(*zoomSpinner, 1, 2, 0, 1, Gtk::EXPAND | Gtk::FILL, Gtk::EXPAND | Gtk::FILL, 0, 0); Gtk::Label *fpsLabel = manage(new Gtk::Label(_("_FPS"))); fpsLabel->set_alignment(0, 0.5); fpsLabel->set_use_underline(TRUE); Gtk::SpinButton *fpsSpinner = manage(new Gtk::SpinButton(adj_fps, 1, 1)); fpsLabel->set_mnemonic_widget(*fpsSpinner); fpsSpinner->set_alignment(1); generalTable->attach(*fpsLabel, 0, 1, 1, 2, Gtk::SHRINK | Gtk::FILL, Gtk::EXPAND | Gtk::FILL, 0, 0); generalTable->attach(*fpsSpinner, 1, 2, 1, 2, Gtk::EXPAND | Gtk::FILL, Gtk::EXPAND | Gtk::FILL, 0, 0); Gtk::Frame *timeFrame = manage(new Gtk::Frame(_("Time settings"))); timeFrame->set_shadow_type(Gtk::SHADOW_NONE); ((Gtk::Label *) timeFrame->get_label_widget())->set_markup(_("<b>Time settings</b>")); dialogBox->pack_start(*timeFrame, false, false, 0); Gtk::Alignment *timePadding = manage(new Gtk::Alignment(0, 0, 1, 1)); timePadding->set_padding(6, 0, 24, 0); timeFrame->add(*timePadding); Gtk::Table *timeTable = manage(new Gtk::Table(2, 2, false)); timeTable->set_row_spacings(6); timeTable->set_col_spacings(12); timePadding->add(*timeTable); check_overbegin.set_alignment(0, 0.5); check_overbegin.set_use_underline(TRUE); check_overend.set_alignment(0, 0.5); check_overend.set_use_underline(TRUE); time_begin.set_alignment(1); time_end.set_alignment(1); timeTable->attach(check_overbegin, 0, 1, 0, 1, Gtk::SHRINK | Gtk::FILL, Gtk::EXPAND | Gtk::FILL, 0, 0); timeTable->attach(time_begin, 1, 2, 0, 1, Gtk::EXPAND | Gtk::FILL, Gtk::EXPAND | Gtk::FILL, 0, 0); timeTable->attach(check_overend, 0, 1, 1, 2, Gtk::SHRINK | Gtk::FILL, Gtk::EXPAND | Gtk::FILL, 0, 0); timeTable->attach(time_end, 1, 2, 1, 2, Gtk::EXPAND | Gtk::FILL, Gtk::EXPAND | Gtk::FILL, 0, 0); check_overbegin.signal_toggled().connect(sigc::mem_fun(*this,&Dialog_PreviewOptions::on_overbegin_toggle)); check_overend.signal_toggled().connect(sigc::mem_fun(*this,&Dialog_PreviewOptions::on_overend_toggle)); Gtk::Button *cancelButton = manage(new Gtk::Button(Gtk::StockID("gtk-cancel"))); cancelButton->signal_clicked().connect(sigc::mem_fun(*this, &Dialog_PreviewOptions::on_cancel_pressed)); add_action_widget(*cancelButton, 1); cancelButton->show(); Gtk::Button *okbutton = manage(new Gtk::Button(Gtk::StockID("gtk-go-forward"))); okbutton->set_label(_("Preview")); okbutton->signal_clicked().connect(sigc::mem_fun(*this,&Dialog_PreviewOptions::on_ok_pressed)); add_action_widget(*okbutton, 0); okbutton->show(); time_begin.set_sensitive(false); time_end.set_sensitive(false); show_all(); }
Gobby::StatusBar::MessageHandle Gobby::StatusBar::add_message(Gobby::StatusBar::MessageType type, const Glib::ustring& message, const Glib::ustring& dialog_message, unsigned int timeout) { if(m_visible_messages >= 12) { for(MessageHandle iter = m_list.begin(); iter != m_list.end(); ++iter) { if(*iter) { if((*iter)->is_error()) remove_message(iter); else // only hide message because whoever // installed it is expecting to be // able to call remove_message on it hide_message(iter); break; } } } Gtk::Grid* grid = Gtk::manage(new Gtk::Grid()); grid->set_column_spacing(6); grid->set_margin_start(2); grid->set_margin_end(2); Gtk::Image* image = Gtk::manage(new Gtk::Image); image->set_from_icon_name(message_type_to_icon_name(type), Gtk::ICON_SIZE_MENU); grid->attach(*image, 0, 0, 1, 1); image->show(); Gtk::Label* label = Gtk::manage( new Gtk::Label(message, Gtk::ALIGN_START)); label->set_ellipsize(Pango::ELLIPSIZE_END); // If we set halign instead, the label will not behave correctly // when ellipsized, because then it has always all space around it // allocated, and the alignment "jumps" around whin resizing the // window due to new characters appearing or disappearing as a result // of the ellipsization. #if GTK_CHECK_VERSION(3, 16, 0) gtk_label_set_xalign(label->gobj(), 0.0); #else label->set_alignment(0.0, 0.0); #endif label->show(); grid->attach(*label, 1, 0, 1, 1); Gtk::Frame* frame = Gtk::manage(new Gtk::Frame); m_list.push_back(0); Gobby::StatusBar::MessageHandle iter(--m_list.end()); sigc::connection timeout_conn; if(timeout) { timeout_conn = Glib::signal_timeout().connect_seconds( sigc::bind( sigc::bind_return( sigc::mem_fun( *this, &StatusBar::remove_message), false), iter), timeout); } *iter = new Message(frame, message, dialog_message, timeout_conn); ++m_visible_messages; if(dialog_message.empty()) { frame->add(*grid); } else { Gtk::EventBox *eventbox = Gtk::manage(new Gtk::EventBox); frame->add(*eventbox); eventbox->add(*grid); eventbox->signal_button_press_event().connect( sigc::bind_return(sigc::bind( sigc::mem_fun( *this, &StatusBar::on_message_clicked), iter), false)); eventbox->show(); } grid->show(); // Insert at front gtk_grid_attach_next_to( gobj(), GTK_WIDGET(frame->gobj()), NULL, GTK_POS_LEFT, 1, 1); frame->set_halign(Gtk::ALIGN_START); frame->set_hexpand(false); frame->set_shadow_type(Gtk::SHADOW_NONE); frame->show(); return iter; }
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(); }
Widget_Waypoint::Widget_Waypoint(etl::handle<synfig::Canvas> canvas): Gtk::Alignment(0, 0, 1, 1), waypoint(synfig::ValueBase(),0), adj_tension(Gtk::Adjustment::create(0.0,-20,20,0.1,1)), adj_continuity(Gtk::Adjustment::create(0.0,-20,20,0.1,1)), adj_bias(Gtk::Adjustment::create(0.0,-20,20,0.1,1)), adj_temporal_tension(Gtk::Adjustment::create(0.0,-20,20,0.1,1)) { value_widget=manage(new Widget_ValueBase()); value_widget->set_canvas(canvas); value_widget->show(); value_node_label=manage(new Gtk::Label(_("(Non-static value)"))); time_widget=manage(new Widget_Time()); time_widget->set_fps(canvas->rend_desc().get_frame_rate()); before_options=manage(new class Widget_Enum()); before_options->show(); before_options->set_param_desc( ParamDesc("interpolation") .set_hint("enum") .add_enum_value(INTERPOLATION_CLAMPED,"clamped",_("Clamped")) .add_enum_value(INTERPOLATION_TCB,"auto",_("TCB")) .add_enum_value(INTERPOLATION_CONSTANT,"constant",_("Constant")) .add_enum_value(INTERPOLATION_HALT,"ease",_("Ease In/Out")) .add_enum_value(INTERPOLATION_LINEAR,"linear",_("Linear")) ); before_options->set_icon(0, Gtk::Button().render_icon_pixbuf(Gtk::StockID("synfig-interpolation_type_clamped"),Gtk::ICON_SIZE_MENU)); before_options->set_icon(1, Gtk::Button().render_icon_pixbuf(Gtk::StockID("synfig-interpolation_type_tcb"),Gtk::ICON_SIZE_MENU)); before_options->set_icon(2, Gtk::Button().render_icon_pixbuf(Gtk::StockID("synfig-interpolation_type_const"),Gtk::ICON_SIZE_MENU)); before_options->set_icon(3, Gtk::Button().render_icon_pixbuf(Gtk::StockID("synfig-interpolation_type_ease"),Gtk::ICON_SIZE_MENU)); before_options->set_icon(4, Gtk::Button().render_icon_pixbuf(Gtk::StockID("synfig-interpolation_type_linear"),Gtk::ICON_SIZE_MENU)); after_options=manage(new class Widget_Enum()); after_options->show(); after_options->set_param_desc( ParamDesc("interpolation") .set_hint("enum") .add_enum_value(INTERPOLATION_CLAMPED,"clamped",_("Clamped")) .add_enum_value(INTERPOLATION_TCB,"auto",_("TCB")) .add_enum_value(INTERPOLATION_CONSTANT,"constant",_("Constant")) .add_enum_value(INTERPOLATION_HALT,"ease",_("Ease In/Out")) .add_enum_value(INTERPOLATION_LINEAR,"linear",_("Linear")) ); after_options->set_icon(0, Gtk::Button().render_icon_pixbuf(Gtk::StockID("synfig-interpolation_type_clamped"),Gtk::ICON_SIZE_MENU)); after_options->set_icon(1, Gtk::Button().render_icon_pixbuf(Gtk::StockID("synfig-interpolation_type_tcb"),Gtk::ICON_SIZE_MENU)); after_options->set_icon(2, Gtk::Button().render_icon_pixbuf(Gtk::StockID("synfig-interpolation_type_const"),Gtk::ICON_SIZE_MENU)); after_options->set_icon(3, Gtk::Button().render_icon_pixbuf(Gtk::StockID("synfig-interpolation_type_ease"),Gtk::ICON_SIZE_MENU)); after_options->set_icon(4, Gtk::Button().render_icon_pixbuf(Gtk::StockID("synfig-interpolation_type_linear"),Gtk::ICON_SIZE_MENU)); spin_tension=manage(new class Gtk::SpinButton(adj_tension,0.1,3)); spin_tension->show(); spin_continuity=manage(new class Gtk::SpinButton(adj_continuity,0.1,3)); spin_continuity->show(); spin_bias=manage(new class Gtk::SpinButton(adj_bias,0.1,3)); spin_bias->show(); spin_temporal_tension=manage(new class Gtk::SpinButton(adj_temporal_tension,0.1,3)); spin_temporal_tension->show(); set_padding(12, 12, 12, 12); Gtk::VBox *widgetBox = manage(new Gtk::VBox(false, 12)); add(*widgetBox); Gtk::Frame *waypointFrame = manage(new Gtk::Frame(_("Waypoint"))); waypointFrame->set_shadow_type(Gtk::SHADOW_NONE); ((Gtk::Label *) waypointFrame->get_label_widget())->set_markup(_("<b>Waypoint</b>")); widgetBox->pack_start(*waypointFrame, false, false, 0); Gtk::Alignment *waypointPadding = manage(new Gtk::Alignment(0, 0, 1, 1)); waypointPadding->set_padding(6, 0, 24, 0); waypointFrame->add(*waypointPadding); Gtk::Table *waypointTable = manage(new Gtk::Table(2, 2, false)); waypointTable->set_row_spacings(6); waypointTable->set_col_spacings(12); waypointPadding->add(*waypointTable); Gtk::Label *waypointValueLabel = manage(new Gtk::Label(_("_Value"), true)); waypointValueLabel->set_alignment(0, 0.5); waypointValueLabel->set_mnemonic_widget(*value_widget); waypointTable->attach(*waypointValueLabel, 0, 1, 0, 1, Gtk::SHRINK | Gtk::FILL, Gtk::EXPAND | Gtk::FILL, 0, 0); waypointTable->attach(*value_widget, 1, 2, 0, 1, Gtk::EXPAND | Gtk::FILL, Gtk::EXPAND | Gtk::FILL, 0, 0); waypointTable->attach(*value_node_label, 1, 2, 0, 1, Gtk::EXPAND | Gtk::FILL, Gtk::EXPAND | Gtk::FILL, 0, 0); Gtk::Label *waypointTimeLabel = manage(new Gtk::Label(_("_Time"), true)); waypointTimeLabel->set_alignment(0, 0.5); waypointTimeLabel->set_mnemonic_widget(*time_widget); waypointTable->attach(*waypointTimeLabel, 0, 1, 1, 2, Gtk::SHRINK | Gtk::FILL, Gtk::EXPAND | Gtk::FILL, 0, 0); waypointTable->attach(*time_widget, 1, 2, 1, 2, Gtk::EXPAND | Gtk::FILL, Gtk::EXPAND | Gtk::FILL, 0, 0); Gtk::Frame *interpolationFrame = manage(new Gtk::Frame(_("Interpolation"))); interpolationFrame->set_shadow_type(Gtk::SHADOW_NONE); ((Gtk::Label *) interpolationFrame->get_label_widget())->set_markup(_("<b>Interpolation</b>")); widgetBox->pack_start(*interpolationFrame, false, false, 0); Gtk::Alignment *interpolationPadding = manage(new Gtk::Alignment(0, 0, 1, 1)); interpolationPadding->set_padding(6, 0, 24, 0); interpolationFrame->add(*interpolationPadding); Gtk::Table *interpolationTable = manage(new Gtk::Table(2, 2, false)); interpolationTable->set_row_spacings(6); interpolationTable->set_col_spacings(12); interpolationPadding->add(*interpolationTable); Gtk::Label *interpolationInLabel = manage(new Gtk::Label(_("_In Interpolation"), true)); interpolationInLabel->set_alignment(0, 0.5); interpolationInLabel->set_mnemonic_widget(*before_options); interpolationTable->attach(*interpolationInLabel, 0, 1, 0, 1, Gtk::SHRINK | Gtk::FILL, Gtk::EXPAND | Gtk::FILL, 0, 0); interpolationTable->attach(*before_options, 1, 2, 0, 1, Gtk::EXPAND | Gtk::FILL, Gtk::EXPAND | Gtk::FILL, 0, 0); Gtk::Label *interpolationOutLabel = manage(new Gtk::Label(_("_Out Interpolation"), true)); interpolationOutLabel->set_alignment(0, 0.5); interpolationOutLabel->set_mnemonic_widget(*after_options); interpolationTable->attach(*interpolationOutLabel, 0, 1, 1, 2, Gtk::SHRINK | Gtk::FILL, Gtk::EXPAND | Gtk::FILL, 0, 0); interpolationTable->attach(*after_options, 1, 2, 1, 2, Gtk::SHRINK | Gtk::FILL, Gtk::EXPAND | Gtk::FILL, 0, 0); Gtk::Frame *tcbFrame = manage(new Gtk::Frame(_("TCB Parameters"))); tcbFrame->set_shadow_type(Gtk::SHADOW_NONE); ((Gtk::Label *) tcbFrame->get_label_widget())->set_markup(_("<b>TCB Parameter</b>")); widgetBox->pack_start(*tcbFrame, false, false, 0); Gtk::Alignment *tcbPadding = manage(new Gtk::Alignment(0, 0, 1, 1)); tcbPadding->set_padding(6, 0, 24, 0); tcbFrame->add(*tcbPadding); Gtk::Table *tcbTable = manage(new Gtk::Table(4, 2, false)); tcbTable->set_row_spacings(6); tcbTable->set_col_spacings(12); tcbPadding->add(*tcbTable); Gtk::Label *tensionLabel = manage(new Gtk::Label(_("T_ension"), true)); tensionLabel->set_alignment(0, 0.5); tensionLabel->set_mnemonic_widget(*spin_tension); spin_tension->set_alignment(1); tcbTable->attach(*tensionLabel, 0, 1, 0, 1, Gtk::SHRINK | Gtk::FILL, Gtk::EXPAND | Gtk::FILL, 0, 0); tcbTable->attach(*spin_tension, 1, 2, 0, 1, Gtk::EXPAND | Gtk::FILL, Gtk::EXPAND | Gtk::FILL, 0, 0); Gtk::Label *continuityLabel = manage(new Gtk::Label(_("_Continuity"), true)); continuityLabel->set_alignment(0, 0.5); continuityLabel->set_mnemonic_widget(*spin_continuity); spin_continuity->set_alignment(1); tcbTable->attach(*continuityLabel, 0, 1, 1, 2, Gtk::SHRINK | Gtk::FILL, Gtk::EXPAND | Gtk::FILL, 0, 0); tcbTable->attach(*spin_continuity, 1, 2, 1, 2, Gtk::EXPAND | Gtk::FILL, Gtk::EXPAND | Gtk::FILL, 0, 0); Gtk::Label *biasLabel = manage(new Gtk::Label(_("_Bias"), true)); biasLabel->set_alignment(0, 0.5); biasLabel->set_mnemonic_widget(*spin_bias); spin_bias->set_alignment(1); tcbTable->attach(*biasLabel, 0, 1, 2, 3, Gtk::SHRINK | Gtk::FILL, Gtk::EXPAND | Gtk::FILL, 0, 0); tcbTable->attach(*spin_bias, 1, 2, 2, 3, Gtk::EXPAND | Gtk::FILL, Gtk::EXPAND | Gtk::FILL, 0, 0); Gtk::Label *temporalTensionLabel = manage(new Gtk::Label(_("Te_mporal Tension"), true)); temporalTensionLabel->set_alignment(0, 0.5); temporalTensionLabel->set_mnemonic_widget(*spin_temporal_tension); spin_temporal_tension->set_alignment(1); tcbTable->attach(*temporalTensionLabel, 0, 1, 3, 4, Gtk::SHRINK | Gtk::FILL, Gtk::EXPAND | Gtk::FILL, 0, 0); tcbTable->attach(*spin_temporal_tension, 1, 2, 3, 4, Gtk::EXPAND | Gtk::FILL, Gtk::EXPAND | Gtk::FILL, 0, 0); show_all(); hide(); set_canvas(canvas); }
dialog_localsettings::dialog_localsettings() { this->set_size_request(350, -1); this->set_title("Local Settings"); this->add_button(Gtk::Stock::CANCEL, Gtk::RESPONSE_CANCEL); this->add_button(Gtk::Stock::OK, Gtk::RESPONSE_OK); Gtk::Frame *frame = Gtk::manage(new Gtk::Frame); frame->set_margin_top(5); frame->set_margin_left(5); frame->set_margin_right(5); frame->set_margin_bottom(5); frame->set_hexpand(true); frame->set_vexpand(true); Gtk::Grid *grid = Gtk::manage(new Gtk::Grid); grid->set_margin_top(15); grid->set_margin_left(15); grid->set_margin_right(15); grid->set_margin_bottom(15); grid->set_hexpand(true); grid->set_vexpand(true); grid->set_row_spacing(15); frame->add(*grid); Gtk::Label *label = Gtk::manage(new Gtk::Label("Host: ")); label->set_halign(Gtk::ALIGN_END); grid->attach(*label, 0, 0, 1, 1); eHost = Gtk::manage(new Gtk::Entry); eHost->set_hexpand(true); grid->attach(*eHost, 1, 0, 1, 1); label = Gtk::manage(new Gtk::Label("Username: "******"Password: "******"Update Interval: ")); label->set_halign(Gtk::ALIGN_END); grid->attach(*label, 0, 3, 1, 1); Gtk::Box *box = Gtk::manage(new Gtk::Box(Gtk::ORIENTATION_HORIZONTAL, 0)); grid->attach(*box, 1, 3, 1, 1); sUpdateInterval = Gtk::manage(new Gtk::SpinButton(Gtk::Adjustment::create(5.0, 1.0, 60.0, 1.0, 10.0, 0.0), 0.0, 0)); sUpdateInterval->set_hexpand(false); box->pack_start(*sUpdateInterval, Gtk::PACK_EXPAND_WIDGET, 2); label = Gtk::manage(new Gtk::Label("(seconds)")); label->set_halign(Gtk::ALIGN_END); box->pack_start(*label, Gtk::PACK_EXPAND_WIDGET, 2); frame->show_all(); this->get_content_area()->add(*frame); }
Gtk::Widget * Widget_RendDesc::create_image_tab() { Gtk::Alignment *paddedPanel = manage(new Gtk::Alignment(0, 0, 1, 1)); paddedPanel->set_padding(12, 12, 12, 12); Gtk::Box *panelBox = manage(new Gtk::Box(Gtk::ORIENTATION_VERTICAL, 12)); panelBox->set_homogeneous(false); paddedPanel->add(*panelBox); Gtk::Frame *imageSizeFrame = manage(new Gtk::Frame(_("Image Size"))); imageSizeFrame->set_shadow_type(Gtk::SHADOW_NONE); ((Gtk::Label *) imageSizeFrame->get_label_widget())->set_markup(_("<b>Image Size</b>")); // panelBox->pack_start(*imageSizeFrame, false, false, 0); panelBox->pack_start(*imageSizeFrame, Gtk::PACK_SHRINK); Gtk::Alignment *tableSizePadding = manage(new Gtk::Alignment(0, 0, 1, 1)); tableSizePadding->set_padding(6, 0, 24, 0); Gtk::Grid *imageSizeGrid = manage(new Gtk::Grid()); tableSizePadding->add(*imageSizeGrid); imageSizeFrame->add(*tableSizePadding); Gtk::Label *size_width_label = manage(new Gtk::Label(_("_Width"), 0, 0.5, true)); size_width_label->set_mnemonic_widget(*entry_width); Gtk::Label *size_height_label = manage(new Gtk::Label(_("_Height"), 0, 0.5, true)); size_height_label->set_mnemonic_widget(*entry_height); Gtk::Label *size_xres_label = manage(new Gtk::Label(_("_XRes"), 0, 0.5, true)); size_xres_label->set_mnemonic_widget(*entry_xres); Gtk::Label *size_yres_label = manage(new Gtk::Label(_("_YRes"), 0, 0.5, true)); size_yres_label->set_mnemonic_widget(*entry_yres); Gtk::Label *size_physwidth_label = manage(new Gtk::Label(_("_Physical Width"), 0, 0.5, true)); size_physwidth_label->set_mnemonic_widget(*entry_phy_width); Gtk::Label *size_physheight_label = manage(new Gtk::Label(_("Phy_sical Height"), 0, 0.5, true)); size_physheight_label->set_mnemonic_widget(*entry_phy_height); imageSizeGrid->set_row_spacing(6); imageSizeGrid->attach(*size_width_label, 0, 0, 1, 1); imageSizeGrid->attach(*size_height_label, 0, 1, 1, 1); entry_width->set_hexpand(true); entry_height->set_hexpand(true); imageSizeGrid->attach(*entry_width, 1, 0, 1, 1); imageSizeGrid->attach(*entry_height, 1, 1, 1, 1); toggle_wh_ratio->set_margin_right(6); imageSizeGrid->attach(*toggle_wh_ratio, 2, 0, 1, 2); imageSizeGrid->attach(*size_xres_label, 3, 0, 1, 1); imageSizeGrid->attach(*size_yres_label, 3, 1, 1, 1); entry_xres->set_hexpand(true); entry_yres->set_hexpand(true); imageSizeGrid->attach(*entry_xres, 4, 0, 1, 1); imageSizeGrid->attach(*entry_yres, 4, 1, 1, 1); toggle_res_ratio->set_margin_right(6); imageSizeGrid->attach(*toggle_res_ratio, 5, 0, 1, 2); imageSizeGrid->attach(*size_physwidth_label, 6, 0, 1, 1); imageSizeGrid->attach(*size_physheight_label, 6, 1, 1, 1); entry_phy_width->set_hexpand(true); entry_phy_height->set_hexpand(true); imageSizeGrid->attach(*entry_phy_width, 7, 0, 1, 1); imageSizeGrid->attach(*entry_phy_height, 7, 1, 1, 1); imageSizeGrid->attach(*pixel_ratio_label, 0, 3, 3, 1); Gtk::Frame *imageAreaFrame = manage(new Gtk::Frame(_("Image Area"))); imageAreaFrame->set_shadow_type(Gtk::SHADOW_NONE); ((Gtk::Label *) imageAreaFrame->get_label_widget())->set_markup(_("<b>Image Area</b>")); //panelBox->pack_start(*imageAreaFrame, false, false, 0); panelBox->pack_start(*imageAreaFrame, Gtk::PACK_SHRINK); Gtk::Alignment *imageAreaPadding = manage(new Gtk::Alignment(0, 0, 1, 1)); imageAreaPadding->set_padding(6, 0, 24, 0); imageAreaFrame->add(*imageAreaPadding); Gtk::Box *imageAreaBox = manage(new Gtk::Box(Gtk::ORIENTATION_HORIZONTAL,12)); Gtk::Box *imageAreaTlbrLabelBox = Gtk::manage(new Gtk::Box(Gtk::ORIENTATION_VERTICAL,6)); Gtk::Box *imageAreaTlbrBox = manage(new Gtk::Box(Gtk::ORIENTATION_VERTICAL,6)); Gtk::Box *imageAreaSpanBox = manage(new Gtk::Box(Gtk::ORIENTATION_HORIZONTAL,6)); imageAreaPadding->add(*imageAreaBox); Gtk::Label *imageAreaTopLeftLabel = manage(new Gtk::Label(_("_Top Left"), 0, 0.5, true)); imageAreaTopLeftLabel->set_mnemonic_widget(*entry_tl); Gtk::Label *imageAreaBottomRightLabel = manage(new Gtk::Label(_("_Bottom Right"), 0, 0.5, true)); imageAreaBottomRightLabel->set_mnemonic_widget(*entry_br); Gtk::Label *size_span = manage(new Gtk::Label(_("I_mage Span"), 0, 0.5, true)); size_span->set_mnemonic_widget(*entry_span); imageAreaTlbrLabelBox->pack_start(*imageAreaTopLeftLabel); imageAreaTlbrLabelBox->pack_start(*imageAreaBottomRightLabel); imageAreaTlbrBox->pack_start(*entry_tl); imageAreaTlbrBox->pack_start(*entry_br); imageAreaSpanBox->pack_start(*size_span); imageAreaSpanBox->pack_start(*entry_span); imageAreaBox->pack_start(*imageAreaTlbrLabelBox); imageAreaBox->pack_start(*imageAreaTlbrBox); imageAreaBox->pack_start(*imageAreaSpanBox); paddedPanel->show_all(); return paddedPanel; }
Gobby::StatusBar::MessageHandle Gobby::StatusBar::add_message(Gobby::StatusBar::MessageType type, const Glib::ustring& message, const Glib::ustring& dialog_message, unsigned int timeout) { if(m_visible_messages >= 12) { for(MessageHandle iter = m_list.begin(); iter != m_list.end(); ++iter) { if(*iter) { if((*iter)->is_error()) remove_message(iter); else // only hide message because whoever // installed it is expecting to be // able to call remove_message on it hide_message(iter); break; } } } Gtk::HBox* bar = Gtk::manage(new Gtk::HBox); Gtk::Image* image = Gtk::manage(new Gtk::Image( message_type_to_stock_id(type), Gtk::ICON_SIZE_MENU)); bar->pack_start(*image, Gtk::PACK_SHRINK); image->show(); Gtk::Label* label = Gtk::manage( new Gtk::Label(message, GtkCompat::ALIGN_LEFT)); label->set_ellipsize(Pango::ELLIPSIZE_END); bar->pack_start(*label, Gtk::PACK_EXPAND_WIDGET); label->show(); GtkShadowType shadow_type; gtk_widget_style_get(GTK_WIDGET(m_bar_position.gobj()), "shadow-type", &shadow_type, NULL); Gtk::Frame* frame = Gtk::manage(new Gtk::Frame); m_list.push_back(0); Gobby::StatusBar::MessageHandle iter(--m_list.end()); sigc::connection timeout_conn; if(timeout) { timeout_conn = Glib::signal_timeout().connect_seconds( sigc::bind( sigc::bind_return( sigc::mem_fun( *this, &StatusBar::remove_message), false), iter), timeout); } *iter = new Message(frame, message, dialog_message, timeout_conn); ++m_visible_messages; if(dialog_message.empty()) { frame->add(*bar); } else { Gtk::EventBox *eventbox = Gtk::manage(new Gtk::EventBox); frame->add(*eventbox); eventbox->add(*bar); eventbox->signal_button_press_event().connect( sigc::bind_return(sigc::bind( sigc::mem_fun( *this, &StatusBar::on_message_clicked), iter), false)); eventbox->show(); } frame->set_shadow_type(static_cast<Gtk::ShadowType>(shadow_type)); bar->show(); pack_start(*frame, Gtk::PACK_EXPAND_WIDGET); reorder_child(*frame, 0); frame->show(); return iter; }
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(); }