X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=libs%2Fgtkmm2ext%2Fgtkmm2ext%2Fprompter.h;h=72d9f2149bdf0bfc066958bbaedad363d64f6a87;hb=11619a37bff79c050e39e434bc9899b516cbe4a1;hp=5997cc8b243c88ab936f9d5933afc65def2d349f;hpb=d09f6b3016bacbc2871a8946cbb24ad705076509;p=ardour.git diff --git a/libs/gtkmm2ext/gtkmm2ext/prompter.h b/libs/gtkmm2ext/gtkmm2ext/prompter.h index 5997cc8b24..72d9f2149b 100644 --- a/libs/gtkmm2ext/gtkmm2ext/prompter.h +++ b/libs/gtkmm2ext/gtkmm2ext/prompter.h @@ -15,23 +15,30 @@ along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - $Id$ */ #ifndef __gtkmm2ext_prompter_h__ #define __gtkmm2ext_prompter_h__ #include -#include +#include +#include +#include +#include #include +namespace Gtk { + class Window; +} + namespace Gtkmm2ext { -class Prompter : public Gtk::Window +class Prompter : public Gtk::Dialog { public: Prompter (bool modal = false); + Prompter (Gtk::Window& parent, bool modal = false); ~Prompter () {}; void set_prompt (std::string prompt) { @@ -45,40 +52,23 @@ class Prompter : public Gtk::Window void change_labels (std::string ok, std::string cancel); - enum PrompterStatus { - entered, - cancelled - }; - - PrompterStatus status; - void get_result (std::string &str); - - /* the prompter will send a `done' signal when it is finished. - the "caller" can then check `status' and if it wants to - can then call `get_result()'. - */ - - sigc::signal done; + void get_result (std::string &str, bool strip=true); protected: Gtk::Entry& the_entry() { return entry; } + void on_entry_changed (); + void on_show (); + private: - Gtk::VBox packer; - Gtk::HBox buttonBox; Gtk::Entry entry; - Gtk::VBox entryBox; + Gtk::HBox entryBox; Gtk::Label entryLabel; - Gtk::Button ok; - Gtk::Button cancel; - - void activated (); - void cancel_click (); - - bool deleted (GdkEventAny *); + bool first_show; + bool can_accept_from_entry; - void on_realize (); - void on_map (); + void init (); + void entry_activated (); }; } /* namespace */