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 "ControlERT.h"
22 #include <libglademm.h>
29 GERT::GERT(Dialog & parent)
30 : GViewCB<ControlERT, GViewGladeB>(parent, _("TeX Settings"), false)
36 string const gladeName = findGladeFile("ERT");
37 xml_ = Gnome::Glade::Xml::create(gladeName);
39 Gtk::Button * cancelbutton;
40 xml_->get_widget("Close", cancelbutton);
41 setCancel(cancelbutton);
43 xml_->get_widget("Inline", inlineradio_);
44 xml_->get_widget("Open", openradio_);
45 xml_->get_widget("Collapsed", collapsedradio_);
47 inlineradio_->signal_toggled().connect(
48 sigc::mem_fun(*this, &GERT::apply));
49 openradio_->signal_toggled().connect(
50 sigc::mem_fun(*this, &GERT::apply));
51 collapsedradio_->signal_toggled().connect(
52 sigc::mem_fun(*this, &GERT::apply));
54 bcview().addReadOnly(inlineradio_);
55 bcview().addReadOnly(openradio_);
56 bcview().addReadOnly(collapsedradio_);
64 bc().refreshReadOnly();
66 switch (controller().status()) {
68 openradio_->set_active(true);
70 case InsetERT::Collapsed:
71 collapsedradio_->set_active(true);
73 case InsetERT::Inlined:
74 inlineradio_->set_active(true);
87 if (openradio_->get_active())
88 controller().setStatus(InsetERT::Open);
89 else if (collapsedradio_->get_active())
90 controller().setStatus(InsetERT::Collapsed);
92 controller().setStatus(InsetERT::Inlined);
94 controller().dispatchParams();
97 } // namespace frontend