X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=synfig-studio%2Ftrunk%2Fsrc%2Fgtkmm%2Fapp.cpp;h=9a07be542652b0e952c0fccc326c545a188764db;hb=3484095c16bf58e9d8a27cf14bbd971a5b504c38;hp=feb0c025df21bd97e2685f09348b7cdd72f07a27;hpb=66f4173f0900b23b5907953a88e0f00a62053119;p=synfig.git diff --git a/synfig-studio/trunk/src/gtkmm/app.cpp b/synfig-studio/trunk/src/gtkmm/app.cpp index feb0c02..9a07be5 100644 --- a/synfig-studio/trunk/src/gtkmm/app.cpp +++ b/synfig-studio/trunk/src/gtkmm/app.cpp @@ -54,6 +54,7 @@ #include #include #include +#include #include @@ -2184,8 +2185,8 @@ App::dialog_entry(const std::string &title, const std::string &message,std::stri Gtk::Dialog dialog( title, // Title true, // Modal - true // use_separator - ); + true); // use_separator + Gtk::Label label(message); label.show(); dialog.get_vbox()->pack_start(label); @@ -2194,11 +2195,13 @@ App::dialog_entry(const std::string &title, const std::string &message,std::stri entry.set_text(text); entry.show(); entry.set_activates_default(true); + dialog.get_vbox()->pack_start(entry); dialog.add_button(Gtk::StockID("gtk-ok"),Gtk::RESPONSE_OK); dialog.add_button(Gtk::StockID("gtk-cancel"),Gtk::RESPONSE_CANCEL); dialog.set_default_response(Gtk::RESPONSE_OK); + entry.signal_activate().connect(sigc::bind(sigc::mem_fun(dialog,&Gtk::Dialog::response),Gtk::RESPONSE_OK)); dialog.show(); @@ -2210,8 +2213,39 @@ App::dialog_entry(const std::string &title, const std::string &message,std::stri return true; } +bool +App::dialog_paragraph(const std::string &title, const std::string &message,std::string &text) +{ + Gtk::Dialog dialog( + title, // Title + true, // Modal + true); // use_separator + + Gtk::Label label(message); + label.show(); + dialog.get_vbox()->pack_start(label); + Glib::RefPtr text_buffer(Gtk::TextBuffer::create()); + text_buffer->set_text(text); + Gtk::TextView text_view(text_buffer); + text_view.show(); + dialog.get_vbox()->pack_start(text_view); + + dialog.add_button(Gtk::StockID("gtk-ok"),Gtk::RESPONSE_OK); + dialog.add_button(Gtk::StockID("gtk-cancel"),Gtk::RESPONSE_CANCEL); + dialog.set_default_response(Gtk::RESPONSE_OK); + + //text_entry.signal_activate().connect(sigc::bind(sigc::mem_fun(dialog,&Gtk::Dialog::response),Gtk::RESPONSE_OK)); + dialog.show(); + + if(dialog.run()!=Gtk::RESPONSE_OK) + return false; + + text=text_buffer->get_text(); + + return true; +} bool App::open(std::string filename)