/** * Constructor */ AboutBox::AboutBox() : Gtk::Dialog(_("About Inkscape")) { // call this first initStrings(); Gtk::Notebook *tabs=new Gtk::Notebook(); tabs->set_scrollable(); Gtk::Widget *splash=build_splash_widget(); if (splash) { tabs->append_page(*manage(splash), _("_Splash"), true); } tabs->append_page(*manage( make_scrolled_text(authors_text)), _("_Authors"), true); tabs->append_page(*manage( make_scrolled_text(translators_text)), _("_Translators"), true); tabs->append_page(*manage( make_scrolled_text(license_text)), _("_License"), true); #if WITH_GTKMM_3_0 get_content_area()->pack_end(*manage(tabs), true, true); #else get_vbox()->pack_end(*manage(tabs), true, true); #endif tabs->show_all(); add_button(Gtk::Stock::CLOSE, Gtk::RESPONSE_CLOSE); set_default_response(Gtk::RESPONSE_CLOSE); Gtk::Label *label=new Gtk::Label(); gchar *label_text = g_strdup_printf("<small>Inkscape %s</small>", Inkscape::version_string); label->set_markup(label_text); label->set_alignment(Gtk::ALIGN_END, Gtk::ALIGN_CENTER); label->set_padding(5,0); g_free(label_text); label->set_selectable(true); label->show(); #if WITH_GTKMM_3_0 get_content_area()->pack_start(*manage(label), false, false); #else get_vbox()->pack_start(*manage(label), false, false); #endif Gtk::Requisition requisition; #if GTK_CHECK_VERSION(3,0,0) gtk_widget_get_preferred_size(reinterpret_cast<GtkWidget*>(gobj()), &requisition, NULL); #else gtk_widget_size_request (reinterpret_cast<GtkWidget*>(gobj()), &requisition); #endif // allow window to shrink set_size_request(0, 0); set_default_size(requisition.width, requisition.height); }
WaitingDialog::WaitingDialog(std::string l, bool c) : label(l), cancelable(c) { get_content_area()->pack_start(box); box.pack_start(label); if (cancelable) { cancel.set_label("Anuluj"); box.pack_end(cancel); } get_content_area()->show_all_children(true); }
void c_SelectPointsDlg::InitControls(bool hasAutoBtn) { m_ImgView.signal_ImageAreaBtnPress().connect(sigc::mem_fun(*this, &c_SelectPointsDlg::OnImageBtnPress)); m_ImgView.signal_DrawImageArea().connect(sigc::slot<bool, const Cairo::RefPtr<Cairo::Context>&>( [this](const Cairo::RefPtr<Cairo::Context> &cr) { for (auto &pt: m_Points) Utils::DrawAnchorPoint(cr, m_ImgView.GetZoomPercentVal() * pt.x / 100, m_ImgView.GetZoomPercentVal() * pt.y / 100); return false; } )); m_ImgView.show(); Gtk::Button *btnRemovePts = Gtk::manage(new Gtk::Button(_("Remove points"))); btnRemovePts->signal_clicked().connect(sigc::mem_fun(*this, &c_SelectPointsDlg::OnRemoveClick)); btnRemovePts->show(); Gtk::Button *btnAuto = 0; if (hasAutoBtn) { btnAuto = Gtk::manage(new Gtk::Button(_("Automatic"))); btnAuto->signal_clicked().connect(sigc::mem_fun(*this, &c_SelectPointsDlg::OnAutoClick)); btnAuto->show(); } Gtk::HButtonBox *btnBox = Gtk::manage(new Gtk::HButtonBox()); btnBox->set_layout(Gtk::ButtonBoxStyle::BUTTONBOX_START); btnBox->pack_start(*btnRemovePts, Gtk::PackOptions::PACK_SHRINK); if (hasAutoBtn) { btnBox->pack_start(*btnAuto, Gtk::PackOptions::PACK_SHRINK); } btnBox->show(); get_content_area()->pack_start(*btnBox, Gtk::PackOptions::PACK_SHRINK, Utils::Const::widgetPaddingInPixels); get_content_area()->pack_start(m_ImgView, Gtk::PackOptions::PACK_EXPAND_WIDGET, Utils::Const::widgetPaddingInPixels); m_InfoText.set_alignment(Gtk::ALIGN_START, Gtk::ALIGN_CENTER); m_InfoText.set_ellipsize(Pango::EllipsizeMode::ELLIPSIZE_END); m_InfoText.set_lines(2); get_content_area()->pack_start(m_InfoText, Gtk::PackOptions::PACK_SHRINK, Utils::Const::widgetPaddingInPixels); auto separator = Gtk::manage(new Gtk::Separator()); separator->show(); get_content_area()->pack_end(*separator, Gtk::PackOptions::PACK_SHRINK, Utils::Const::widgetPaddingInPixels); add_button(_("OK"), Gtk::RESPONSE_OK); add_button(_("Cancel"), Gtk::RESPONSE_CANCEL); }
CreateWireframeDialog::CreateWireframeDialog(const Glib::ustring & title) : Dialog(title, true), m_filled(false), m_minVertices(false), m_coordBox(Gtk::manage(new CoordBox())), m_nameLabel(Gtk::manage(new Gtk::Label("Name: "))), m_nameEntry(Gtk::manage(new Gtk::Entry())) { set_size_request(-1, 230); set_resizable(false); set_border_width(10); // Entry for the name Gtk::HBox * const name_hbox = Gtk::manage(new Gtk::HBox()); name_hbox->pack_start(*m_nameLabel, Gtk::PACK_SHRINK, 0); name_hbox->pack_start(*m_nameEntry, Gtk::PACK_EXPAND_WIDGET, 0); name_hbox->set_spacing(0); name_hbox->set_homogeneous(false); // Check box for filling Gtk::CheckButton * const filled_button = Gtk::manage(new Gtk::CheckButton("Filled shape")); filled_button->signal_toggled().connect(sigc::mem_fun(*this, &CreateWireframeDialog::on_filled_button_toggled)); filled_button->set_active(false); get_content_area()->pack_start(*name_hbox, Gtk::PACK_SHRINK, 5); get_content_area()->pack_start(*filled_button, Gtk::PACK_SHRINK, 5); Gtk::Frame * const coord_frame = Gtk::manage(new Gtk::Frame("Points")); Gtk::ScrolledWindow * const scrolled_window = Gtk::manage(new Gtk::ScrolledWindow()); scrolled_window->set_policy(Gtk::POLICY_AUTOMATIC, Gtk::POLICY_AUTOMATIC); scrolled_window->set_size_request(-1, 150); scrolled_window->set_border_width(5); scrolled_window->add(*m_coordBox); m_coordBox->set_spacing(0); coord_frame->add(*scrolled_window); get_content_area()->pack_start(*coord_frame, Gtk::PACK_SHRINK, 0); // Entries for the coordinates m_coordBox->add_coord(); m_coordBox->add_coord(); m_coordBox->add_coord(); // Add buttons (from left to right) add_button("Cancel", Gtk::RESPONSE_CANCEL); add_button("Add point", Gtk::RESPONSE_APPLY); add_button("OK", Gtk::RESPONSE_OK); signal_response().connect_notify(sigc::mem_fun(*this, &CreateWireframeDialog::on_my_response)); set_default_response(Gtk::RESPONSE_OK); show_all_children(); }
void c_PreferencesDlg::InitControls() { for (const Utils::Const::Language_t &lang: Utils::Const::languages) { m_UILanguage.append(lang.name == Utils::Const::SYSTEM_DEFAULT_LANG ? _("System language") : lang.name); if (lang.langId == std::string(Configuration::UILanguage)) m_UILanguage.set_active(m_UILanguage.get_model()->children().size()-1); } get_content_area()->pack_start(*Utils::PackIntoBox<Gtk::HBox>( { Gtk::manage(new Gtk::Label(_("User interface language:"))), &m_UILanguage } ), Gtk::PackOptions::PACK_SHRINK, Utils::Const::widgetPaddingInPixels); int iconSizePx; Gtk::IconSize::lookup(Configuration::GetToolIconSize(), iconSizePx, iconSizePx); m_ToolIconSize.set_adjustment(Gtk::Adjustment::create(iconSizePx, MIN_ICON_SIZE_PIX, MAX_ICON_SIZE_PIX)); m_ToolIconSize.set_digits(0); m_ToolIconSize.set_value_pos(Gtk::PositionType::POS_LEFT); for (unsigned sizeMark: { 8, 16, 24, 32, 40, 64, 80, 100, 128 }) m_ToolIconSize.add_mark(sizeMark, Gtk::PositionType::POS_TOP, Glib::ustring::format(sizeMark)); Gtk::HBox *boxToolIconSize = Gtk::manage(new Gtk::HBox()); boxToolIconSize->pack_start(*Gtk::manage(new Gtk::Label(_("Tool icon size:"))), Gtk::PackOptions::PACK_SHRINK); boxToolIconSize->pack_start(m_ToolIconSize); boxToolIconSize->set_spacing(10); boxToolIconSize->show_all(); get_content_area()->pack_start(*boxToolIconSize, Gtk::PackOptions::PACK_SHRINK, Utils::Const::widgetPaddingInPixels); m_ExportInactiveFramesQuality.set_label(_("Include inactive frames when exporting quality data")); m_ExportInactiveFramesQuality.set_active(Configuration::ExportInactiveFramesQuality); m_ExportInactiveFramesQuality.show(); get_content_area()->pack_start(m_ExportInactiveFramesQuality, Gtk::PackOptions::PACK_SHRINK, Utils::Const::widgetPaddingInPixels); m_NumQualHistBins.set_adjustment(Gtk::Adjustment::create(Configuration::NumQualityHistogramBins, 10, Utils::Const::MaxQualityHistogramBins, 1, 10, 10)); get_content_area()->pack_start(*Utils::PackIntoBox<Gtk::HBox>( { Gtk::manage(new Gtk::Label(_("Number of frame quality histogram bins:"))), &m_NumQualHistBins }), Gtk::PackOptions::PACK_SHRINK, Utils::Const::widgetPaddingInPixels); auto separator = Gtk::manage(new Gtk::Separator()); separator->show(); get_content_area()->pack_end(*separator, Gtk::PackOptions::PACK_SHRINK, Utils::Const::widgetPaddingInPixels); add_button(_("OK"), Gtk::RESPONSE_OK); add_button(_("Cancel"), Gtk::RESPONSE_CANCEL); //FIXME: not working when a Gtk::Entry has focus! #### set_default(*get_widget_for_response(Gtk::ResponseType::RESPONSE_OK)); }
CreatePointDialog::CreatePointDialog(const Glib::ustring & title) : Dialog(title, true), m_nameLabel(Gtk::manage(new Gtk::Label("Name: "))), m_xLabel(Gtk::manage(new Gtk::Label("x: "))), m_yLabel(Gtk::manage(new Gtk::Label("y: "))), m_zLabel(Gtk::manage(new Gtk::Label("z: "))), m_nameEntry(Gtk::manage(new Gtk::Entry())), m_xEntry(Gtk::manage(new Gtk::Entry())), m_yEntry(Gtk::manage(new Gtk::Entry())), m_zEntry(Gtk::manage(new Gtk::Entry())) { set_resizable(false); set_border_width(10); /* Entries size */ m_xEntry->set_width_chars(6); m_yEntry->set_width_chars(6); m_zEntry->set_width_chars(6); Gtk::HBox * const name_hbox = Gtk::manage(new Gtk::HBox()); name_hbox->pack_start(*m_nameLabel, Gtk::PACK_SHRINK, 0); name_hbox->pack_start(*m_nameEntry, Gtk::PACK_EXPAND_WIDGET, 0); name_hbox->set_homogeneous(false); Gtk::HBox * const coord_hbox = Gtk::manage(new Gtk::HBox()); coord_hbox->pack_start(*m_xLabel, Gtk::PACK_EXPAND_PADDING, 0); coord_hbox->pack_start(*m_xEntry, Gtk::PACK_SHRINK, 0); coord_hbox->pack_start(*m_yLabel, Gtk::PACK_EXPAND_PADDING, 0); coord_hbox->pack_start(*m_yEntry, Gtk::PACK_SHRINK, 0); coord_hbox->pack_start(*m_zLabel, Gtk::PACK_EXPAND_PADDING, 0); coord_hbox->pack_start(*m_zEntry, Gtk::PACK_SHRINK, 0); coord_hbox->set_homogeneous(false); get_content_area()->pack_start(*name_hbox); get_content_area()->pack_start(*coord_hbox); add_button("Cancel", Gtk::RESPONSE_CANCEL); add_button("OK", Gtk::RESPONSE_OK); signal_response().connect_notify(sigc::mem_fun(*this, &CreatePointDialog::on_my_response)); set_default_response(Gtk::RESPONSE_OK); show_all_children(); }
url_chooser::url_chooser(std::string& i, std::string& u, std::string& d) : ip_s(i), url_s(u), delim_s(d), advanced_opts("Advanced Options"), ip_l("Camera IP Address: "), url_l("MJPEG Stream Path: "), delim_l("MJPEG Frame Delimiter: ") { //setup entries ip.set_text(ip_s); url.set_text(url_s); delim.set_text(delim_s); //signal handlers ip.signal_focus_out_event().connect(sigc::mem_fun(*this, &url_chooser::ip_changed)); url.signal_focus_out_event().connect(sigc::mem_fun(*this, &url_chooser::url_changed)); delim.signal_focus_out_event().connect(sigc::mem_fun(*this, &url_chooser::delim_changed)); #ifndef USE_DEPRECATED_GTKMM_API //setup frame for advanced options //attach url entry advanced_grid.attach(url_l, 0, 0, 1, 1); advanced_grid.attach(url, 1, 0, 1, 1); //attach delim entry advanced_grid.attach(delim_l, 0, 1, 1, 1); advanced_grid.attach(delim, 1, 1, 1, 1); //put grid in expander advanced_opts.add(advanced_grid); //setup main grid //attach ip address entry content.attach(ip_l, 0, 0, 1, 1); content.attach(ip, 1, 0, 1, 1); //attach advanced frame content.attach(advanced_opts, 0, 1, 2, 1); //add content get_content_area()->add(content); #else ip_box.add(ip_l); ip_box.add(ip); url_box.add(url_l); url_box.add(url); delim_box.add(delim_l); delim_box.add(delim); advanced_box.add(url_box); advanced_box.add(delim_box); advanced_opts.add(advanced_box); content.add(ip_box); content.add(advanced_opts); get_vbox()->add(content); #endif //add button add_button("OK", 0); show_all_children(); }
DeviceSelector::DeviceSelector() { //domyślny rozmiar okna set_default_size(600, 300); //przyciski ok.set_label("OK"); ok.set_sensitive(false); cancel.set_label("Anuluj"); start_search.set_label("Szukaj urządzeń"); //umieszczenie prezycisków hbox.pack_start(ok); hbox.pack_start(cancel); hbox.pack_start(start_search); //łączenie przycisków z akcjami start_search.signal_clicked().connect(sigc::mem_fun(*this, &DeviceSelector::start_search_clicked)); ok.signal_clicked().connect(sigc::mem_fun(*this, &DeviceSelector::ok_clicked)); cancel.signal_clicked().connect(sigc::mem_fun(*this, &DeviceSelector::cancel_clicked)); //widok listy scrolled_window.add(view); ref_tree_model = Gtk::ListStore::create(dtn); view.set_model(ref_tree_model); scrolled_window.set_size_request(400, 300); //kolumny view.append_column("Nazwa", dtn.col_name); view.append_column("MAC", dtn.col_MAC); //umieszczenie pionowe //vbox.pack_start(scrolled_window, Gtk::PACK_EXPAND_PADDING); //vbox.pack_end(hbox, Gtk::PACK_SHRINK); //umieszczenie vboxa w oknie Gtk::Box *tmp = get_content_area(); tmp->pack_start(scrolled_window, Gtk::PACK_EXPAND_PADDING); tmp->pack_end(hbox, Gtk::PACK_SHRINK); //tmp->pack_start(vbox, Gtk::PACK_EXPAND_WIDGET); //wyświetlenie tmp->show_all_children(true); //wyświetlanie urządzeń this->signal_devices_ready().connect(sigc::mem_fun(*this, &DeviceSelector::on_devices_ready)); exiting = exited = false; //szukanie urządzeń search(); }
DebugDialogImpl::DebugDialogImpl() { set_title(_("Messages")); set_size_request(300, 400); #if WITH_GTKMM_3_0 Gtk::Box *mainVBox = get_content_area(); #else Gtk::Box *mainVBox = get_vbox(); #endif //## Add a menu for clear() Gtk::MenuItem* item = Gtk::manage(new Gtk::MenuItem(_("_File"), true)); item->set_submenu(fileMenu); menuBar.append(*item); item = Gtk::manage(new Gtk::MenuItem(_("_Clear"), true)); item->signal_activate().connect(sigc::mem_fun(*this, &DebugDialogImpl::clear)); fileMenu.append(*item); item = Gtk::manage(new Gtk::MenuItem(_("Capture log messages"))); item->signal_activate().connect(sigc::mem_fun(*this, &DebugDialogImpl::captureLogMessages)); fileMenu.append(*item); item = Gtk::manage(new Gtk::MenuItem(_("Release log messages"))); item->signal_activate().connect(sigc::mem_fun(*this, &DebugDialogImpl::releaseLogMessages)); fileMenu.append(*item); mainVBox->pack_start(menuBar, Gtk::PACK_SHRINK); //### Set up the text widget messageText.set_editable(false); textScroll.add(messageText); textScroll.set_policy(Gtk::POLICY_ALWAYS, Gtk::POLICY_ALWAYS); mainVBox->pack_start(textScroll); show_all_children(); message("ready."); message("enable log display by setting "); message("dialogs.debug 'redirect' attribute to 1 in preferences.xml"); handlerDefault = 0; handlerGlibmm = 0; handlerAtkmm = 0; handlerPangomm = 0; handlerGdkmm = 0; handlerGtkmm = 0; }
ExporterDialog::ExporterDialog(Gtk::Widget & browser, gint source_options) throw() : HIGDialog(_("Export"), true, false), destinationVBox_(false, 6), optionsVBox_(false, 6), destinationLabel_("", Gtk::ALIGN_LEFT, Gtk::ALIGN_CENTER, false), destinationAlignment_(Gtk::ALIGN_CENTER, Gtk::ALIGN_CENTER, 1.0, 1.0), optionsLabel_("", Gtk::ALIGN_LEFT, Gtk::ALIGN_CENTER, false), optionsAlignment_(Gtk::ALIGN_CENTER, Gtk::ALIGN_CENTER, 1.0, 1.0), optionsVBox2_(false, 6), archiveCheckButton_((source_options & PHOTO_DESTINATION_CREATE_ARCHIVE_OPTIONAL) ? Gtk::manage(new Gtk::CheckButton( _("_Create an archive"), true)) : 0), exportButton_(), exportImage_(Gtk::Stock::APPLY, Gtk::ICON_SIZE_BUTTON), sourceOptions_(source_options) { set_resizable(false); set_size_request(330, -1); Gtk::VBox & content_area = get_content_area(); content_area.set_spacing(18); content_area.pack_start(destinationVBox_, Gtk::PACK_SHRINK, 0); content_area.pack_start(optionsVBox_, Gtk::PACK_SHRINK, 0); destinationLabel_.set_use_markup(true); { Glib::ustring markup = "<b>"; markup += C_("A group of UI controls", "Destination"); markup += "</b>"; destinationLabel_.set_markup(markup); } destinationVBox_.pack_start(destinationLabel_, Gtk::PACK_SHRINK, 0); destinationAlignment_.set_padding(0, 0, 12, 0); destinationVBox_.pack_start(destinationAlignment_, Gtk::PACK_SHRINK, 0); optionsLabel_.set_use_markup(true); { Glib::ustring markup = "<b>"; markup += C_("A group of UI controls", "Options"); markup += "</b>"; optionsLabel_.set_markup(markup); } optionsVBox_.pack_start(optionsLabel_, Gtk::PACK_SHRINK, 0); optionsAlignment_.set_padding(0, 0, 12, 0); optionsVBox_.pack_start(optionsAlignment_, Gtk::PACK_SHRINK, 0); // Insert a Gtk::Widget specific to the particular destination. destinationAlignment_.add(browser); optionsAlignment_.add(optionsVBox2_); if (0 != archiveCheckButton_) { archiveCheckButton_->set_use_underline(true); optionsVBox2_.pack_start(*archiveCheckButton_, Gtk::PACK_SHRINK, 0); } add_button(Gtk::Stock::CANCEL, Gtk::RESPONSE_CANCEL); exportButton_.set_image(exportImage_); exportButton_.set_use_underline(true); exportButton_.set_label(_("_Export")); add_action_widget(exportButton_, Gtk::RESPONSE_APPLY); show_all_children(); }
CalligraphicProfileRename::CalligraphicProfileRename() : #if WITH_GTKMM_3_0 _layout_table(Gtk::manage(new Gtk::Grid())), #else _layout_table(Gtk::manage(new Gtk::Table(1, 2))), #endif _applied(false) { set_title(_("Edit profile")); #if WITH_GTKMM_3_0 Gtk::Box *mainVBox = get_content_area(); _layout_table->set_column_spacing(4); _layout_table->set_row_spacing(4); #else Gtk::Box *mainVBox = get_vbox(); _layout_table->set_spacings(4); #endif _profile_name_entry.set_activates_default(true); _profile_name_label.set_label(_("Profile name:")); _profile_name_label.set_alignment(1.0, 0.5); #if WITH_GTKMM_3_0 _layout_table->attach(_profile_name_label, 0, 0, 1, 1); _profile_name_entry.set_hexpand(); _layout_table->attach(_profile_name_entry, 1, 0, 1, 1); #else _layout_table->attach(_profile_name_label, 0, 1, 0, 1, Gtk::FILL, Gtk::FILL); _layout_table->attach(_profile_name_entry, 1, 2, 0, 1, Gtk::FILL | Gtk::EXPAND, Gtk::FILL); #endif mainVBox->pack_start(*_layout_table, false, false, 4); // Buttons _close_button.set_use_stock(true); _close_button.set_label(Gtk::Stock::CANCEL.id); _close_button.set_can_default(); _delete_button.set_use_underline(true); _delete_button.set_label(_("Delete")); _delete_button.set_can_default(); _delete_button.set_visible(false); _apply_button.set_use_underline(true); _apply_button.set_label(_("Save")); _apply_button.set_can_default(); _close_button.signal_clicked() .connect(sigc::mem_fun(*this, &CalligraphicProfileRename::_close)); _delete_button.signal_clicked() .connect(sigc::mem_fun(*this, &CalligraphicProfileRename::_delete)); _apply_button.signal_clicked() .connect(sigc::mem_fun(*this, &CalligraphicProfileRename::_apply)); signal_delete_event().connect( sigc::bind_return( sigc::hide(sigc::mem_fun(*this, &CalligraphicProfileRename::_close)), true ) ); add_action_widget(_close_button, Gtk::RESPONSE_CLOSE); add_action_widget(_delete_button, Gtk::RESPONSE_DELETE_EVENT); add_action_widget(_apply_button, Gtk::RESPONSE_APPLY); _apply_button.grab_default(); show_all_children(); }