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.
14 #include "ControlERT.h"
17 #include <libglademm.h>
24 GERT::GERT(Dialog & parent)
25 : GViewCB<ControlERT, GViewGladeB>(parent, _("TeX Settings"), false)
31 string const gladeName = findGladeFile("ERT");
32 xml_ = Gnome::Glade::Xml::create(gladeName);
34 Gtk::Button * cancelbutton;
35 xml_->get_widget("Close", cancelbutton);
36 setCancel(cancelbutton);
38 xml_->get_widget("Inline", inlineradio_);
39 xml_->get_widget("Open", openradio_);
40 xml_->get_widget("Collapsed", collapsedradio_);
42 inlineradio_->signal_toggled().connect(
43 sigc::mem_fun(*this, &GERT::apply));
44 openradio_->signal_toggled().connect(
45 sigc::mem_fun(*this, &GERT::apply));
46 collapsedradio_->signal_toggled().connect(
47 sigc::mem_fun(*this, &GERT::apply));
49 bcview().addReadOnly(inlineradio_);
50 bcview().addReadOnly(openradio_);
51 bcview().addReadOnly(collapsedradio_);
59 bc().refreshReadOnly();
61 switch (controller().status()) {
63 openradio_->set_active(true);
65 case InsetERT::Collapsed:
66 collapsedradio_->set_active(true);
68 case InsetERT::Inlined:
69 inlineradio_->set_active(true);
82 if (openradio_->get_active())
83 controller().setStatus(InsetERT::Open);
84 else if (collapsedradio_->get_active())
85 controller().setStatus(InsetERT::Collapsed);
87 controller().setStatus(InsetERT::Inlined);
89 controller().dispatchParams();
92 } // namespace frontend