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>
38 GText::GText(Dialog & parent, docstring const & title, docstring const & label)
39 : GViewCB<ControlCommand, GViewGladeB>(parent, title),
40 label_(lyx::to_utf8(label)), entry_(0)
47 controller().params().setContents(entry_->get_text());
53 string const contents = support::trim(
54 controller().params().getContents());
55 entry_->set_text(contents);
61 string const gladeName = findGladeFile("text");
62 xml_ = Gnome::Glade::Xml::create(gladeName);
64 Gtk::Button * restore;
68 xml_->get_widget("Label", label);
69 xml_->get_widget("Text", entry_);
70 xml_->get_widget("Restore", restore);
71 xml_->get_widget("Cancel", cancel);
72 xml_->get_widget("Apply", apply);
73 xml_->get_widget("OK", ok);
74 label->set_text(Glib::locale_to_utf8(id_sc::id(label_)));
79 bcview().addReadOnly(entry_);
80 entry_->signal_changed().connect(
81 sigc::mem_fun(*this, >ext::onEntryChanged));
85 void GText::onEntryChanged()
87 bc().valid(!entry_->get_text().empty());
90 } // namespace frontend