3 * Copyright 2001 the LyX Team
4 * Read the file COPYING
6 * \author John Levon <moz@compsoc.man.ac.uk>
11 #include FORMS_H_LOCATION
16 #include "xforms_helpers.h"
19 #include "Alert_pimpl.h"
24 void alert_pimpl(string const & s1, string const & s2, string const & s3)
26 fl_set_resource("flAlert.dismiss.label", _("Dismiss"));
27 fl_show_alert(s1.c_str(), s2.c_str(), s3.c_str(), 0);
31 bool askQuestion_pimpl(string const & s1, string const & s2, string const & s3)
33 fl_set_resource("flQuestion.yes.label", idex(_("Yes|Yy#y")));
34 fl_set_resource("flQuestion.no.label", idex(_("No|Nn#n")));
35 return fl_show_question((s1 + "\n" + s2 + "\n" + s3).c_str(), 0);
39 int askConfirmation_pimpl(string const & s1, string const & s2, string const & s3)
41 fl_set_choices_shortcut(scex(_("Yes|Yy#y")),
43 scex(_("Cancel|^[")));
44 return fl_show_choice(s1.c_str(), s2.c_str(), s3.c_str(),
45 3, idex(_("Yes|Yy#y")),
47 idex(_("Cancel|^[")), 3);
51 pair<bool, string> const askForText_pimpl(string const & msg, string const & dflt)
53 fl_set_resource("flInput.cancel.label", idex(_("Cancel|^[")));
54 fl_set_resource("flInput.ok.label", idex(_("OK|#O")));
55 fl_set_resource("flInput.clear.label", idex(_("Clear|#e")));
56 char const * tmp = fl_show_input(msg.c_str(), dflt.c_str());
58 return make_pair<bool, string>(true, string(tmp));
60 return make_pair<bool, string>(false, string());