2 * \file xforms/Alert_pimpl.C
3 * Read the file COPYING
7 * Full author contact details are available in file CREDITS
13 #pragma implementation
17 #include "Alert_pimpl.h"
18 #include "forms_gettext.h"
22 #include FORMS_H_LOCATION
27 void alert_pimpl(string const & s1, string const & s2, string const & s3)
29 fl_set_resource("flAlert.dismiss.label", _("Dismiss"));
30 fl_show_alert(s1.c_str(), s2.c_str(), s3.c_str(), 0);
34 bool askQuestion_pimpl(string const & s1, string const & s2, string const & s3)
36 fl_set_resource("flQuestion.yes.label", idex(_("Yes|Yy#y")));
37 fl_set_resource("flQuestion.no.label", idex(_("No|Nn#n")));
38 return fl_show_question((s1 + "\n" + s2 + "\n" + s3).c_str(), 0);
42 int askConfirmation_pimpl(string const & s1, string const & s2, string const & s3)
44 fl_set_choices_shortcut(scex(_("Yes|Yy#y")),
46 scex(_("Cancel|^[")));
47 return fl_show_choice(s1.c_str(), s2.c_str(), s3.c_str(),
48 3, idex(_("Yes|Yy#y")),
50 idex(_("Cancel|^[")), 3);
54 pair<bool, string> const askForText_pimpl(string const & msg, string const & dflt)
56 fl_set_resource("flInput.cancel.label", idex(_("Cancel|^[")));
57 fl_set_resource("flInput.ok.label", idex(_("OK|#O")));
58 fl_set_resource("flInput.clear.label", idex(_("Clear|#e")));
59 char const * tmp = fl_show_input(msg.c_str(), dflt.c_str());
61 return make_pair<bool, string>(true, string(tmp));
63 return make_pair<bool, string>(false, string());