2 * \file xforms/Alert_pimpl.C
3 * This file is part of LyX, the document processor.
4 * Licence details can be found in the file COPYING.
8 * Full author contact details are available in file CREDITS
15 #include "Alert_pimpl.h"
16 #include "forms_gettext.h"
18 #include "xforms_helpers.h"
21 #include <boost/tuple/tuple.hpp>
22 #include FORMS_H_LOCATION
28 void alert_pimpl(string const & s1, string const & s2, string const & s3)
30 fl_set_resource("flAlert.dismiss.label", _("Dismiss"));
31 fl_show_alert(s1.c_str(), s2.c_str(), s3.c_str(), 0);
35 int prompt_pimpl(string const &, string const & question,
37 string const & b1, string const & b2, string const & b3)
42 boost::tie(b1label, b1sc) = parse_shortcut(b1);
43 boost::tie(b2label, b2sc) = parse_shortcut(b2);
44 boost::tie(b3label, b3sc) = parse_shortcut(b3);
45 lyxerr << "Parsed " << b1 << " as " << b1label << " and " << b1sc << endl;
48 fl_set_choices_shortcut(b1sc.c_str(), b2sc.c_str(), "");
49 return fl_show_choices(question.c_str(),
50 2, b1label.c_str(), b2label.c_str(), "", default_button + 1) - 1;
52 fl_set_choices_shortcut(b1sc.c_str(), b2sc.c_str(), b3sc.c_str());
53 return fl_show_choices(question.c_str(),
54 3, b1label.c_str(), b2label.c_str(), b3label.c_str(),
55 default_button + 1) - 1;
60 pair<bool, string> const askForText_pimpl(string const & msg, string const & dflt)
62 fl_set_resource("flInput.cancel.label", idex(_("Cancel|^[")).c_str());
63 fl_set_resource("flInput.ok.label", idex(_("OK|^M")).c_str());
64 fl_set_resource("flInput.clear.label", idex(_("Clear|#C")).c_str());
65 char const * tmp = fl_show_input(msg.c_str(), dflt.c_str());
67 return make_pair<bool, string>(true, string(tmp));
69 return make_pair<bool, string>(false, string());