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.
13 // Too hard to make concept checks work with this file
14 #ifdef _GLIBCXX_CONCEPT_CHECKS
15 #undef _GLIBCXX_CONCEPT_CHECKS
17 #ifdef _GLIBCPP_CONCEPT_CHECKS
18 #undef _GLIBCPP_CONCEPT_CHECKS
22 #include "ControlCommand.h"
26 #include "support/lstrings.h"
29 #include <libglademm.h>
36 GText::GText(Dialog & parent, string const & title, string const & label)
37 : GViewCB<ControlCommand, GViewGladeB>(parent, title),
38 label_(label), entry_(0)
45 string const contents = Glib::locale_from_utf8(entry_->get_text());
46 controller().params().setContents(contents);
52 string const contents = support::trim(
53 controller().params().getContents());
54 entry_->set_text(Glib::locale_to_utf8(contents));
60 string const gladeName = findGladeFile("text");
61 xml_ = Gnome::Glade::Xml::create(gladeName);
63 Gtk::Button * restore;
67 xml_->get_widget("Label", label);
68 xml_->get_widget("Text", entry_);
69 xml_->get_widget("Restore", restore);
70 xml_->get_widget("Cancel", cancel);
71 xml_->get_widget("Apply", apply);
72 xml_->get_widget("OK", ok);
73 label->set_text(Glib::locale_to_utf8(id_sc::id(label_)));
78 bcview().addReadOnly(entry_);
79 entry_->signal_changed().connect(
80 sigc::mem_fun(*this, >ext::onEntryChanged));
84 void GText::onEntryChanged()
86 bc().valid(!entry_->get_text().empty());
89 } // namespace frontend