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 _GLIBCPP_CONCEPT_CHECKS
15 #undef _GLIBCPP_CONCEPT_CHECKS
19 #include "ControlCommand.h"
23 #include "support/lstrings.h"
26 #include <libglademm.h>
33 GText::GText(Dialog & parent, string const & title, string const & label)
34 : GViewCB<ControlCommand, GViewGladeB>(parent, title),
35 label_(label), entry_(0)
42 string const contents = Glib::locale_from_utf8(entry_->get_text());
43 controller().params().setContents(contents);
49 string const contents = support::trim(
50 controller().params().getContents());
51 entry_->set_text(Glib::locale_to_utf8(contents));
57 string const gladeName = findGladeFile("text");
58 xml_ = Gnome::Glade::Xml::create(gladeName);
60 Gtk::Button * restore;
64 xml_->get_widget("Label", label);
65 xml_->get_widget("Text", entry_);
66 xml_->get_widget("Restore", restore);
67 xml_->get_widget("Cancel", cancel);
68 xml_->get_widget("Apply", apply);
69 xml_->get_widget("OK", ok);
70 label->set_text(Glib::locale_to_utf8(id_sc::id(label_)));
75 bcview().addReadOnly(entry_);
76 entry_->signal_changed().connect(
77 sigc::mem_fun(*this, >ext::onEntryChanged));
81 void GText::onEntryChanged()
83 bc().valid(!entry_->get_text().empty());
86 } // namespace frontend