3 * This file is part of LyX, the document processor.
4 * Licence details can be found in the file COPYING.
6 * \author Michael Koziarski
8 * Full author contact details are available in file CREDITS.
15 #include "GPreamble.h"
17 #include <gtkmm/textview.h>
18 #include <gtkmm/button.h>
20 GPreamble::GPreamble()
21 : GnomeCB<ControlPreamble>("GPreamble")
25 GPreamble::~GPreamble()
29 void GPreamble::build()
31 // Connect the buttons.
32 ok_btn()->signal_clicked().connect(SigC::slot(*this, &GPreamble::OKClicked));
33 cancel_btn()->signal_clicked().connect(SigC::slot(*this, &GPreamble::CancelClicked));
34 apply_btn()->signal_clicked().connect(SigC::slot(*this, &GPreamble::ApplyClicked));
35 // Manage the buttons state
37 bc().setCancel(cancel_btn());
38 bc().setApply(apply_btn());
42 void GPreamble::apply()
44 // controller().params() = preamble()->get_buffer()->get_text(preamble()->get_buffer()->get_start_iter(),
45 // preamble()->get_buffer()->get_end_iter(),
50 void GPreamble::update()
53 preamble()->get_buffer()->set_text(controller().params());
57 void GPreamble::connect_signals()
59 slot_preamble_ = preamble()->
61 signal_changed().connect(SigC::slot(*this, &GPreamble::InputChanged));
64 void GPreamble::disconnect_signals()
66 slot_preamble_.disconnect();
69 Gtk::Button * GPreamble::ok_btn() const
71 return getWidget<Gtk::Button>("r_ok_btn");
73 Gtk::Button * GPreamble::apply_btn() const
75 return getWidget<Gtk::Button>("r_apply_btn");
77 Gtk::Button * GPreamble::cancel_btn() const
79 return getWidget<Gtk::Button>("r_cancel_btn");
81 Gtk::TextView * GPreamble::preamble() const
83 return getWidget<Gtk::TextView>("r_preamble");