]> git.lyx.org Git - lyx.git/blob - src/frontends/gnome/GPreamble.C
fix math fonts with LyX/Mac
[lyx.git] / src / frontends / gnome / GPreamble.C
1 /**
2  * \file GPreamble.C
3  * This file is part of LyX, the document processor.
4  * Licence details can be found in the file COPYING.
5  *
6  * \author Michael Koziarski
7  *
8  * Full author contact details are available in file CREDITS.
9  */
10
11
12 #include <config.h>
13
14 #include "gnomeBC.h"
15 #include "GPreamble.h"
16
17 #include <gtkmm/textview.h>
18 #include <gtkmm/button.h>
19
20 GPreamble::GPreamble()
21         : GnomeCB<ControlPreamble>("GPreamble")
22 {}
23
24
25 GPreamble::~GPreamble()
26 {}
27
28
29 void GPreamble::build()
30 {
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
36         bc().setOK(ok_btn());
37         bc().setCancel(cancel_btn());
38         bc().setApply(apply_btn());
39         bc().refresh();
40 }
41
42 void GPreamble::apply()
43 {
44 //      controller().params() = preamble()->get_buffer()->get_text(preamble()->get_buffer()->get_start_iter(),
45 //                                                                 preamble()->get_buffer()->get_end_iter(),
46 //                                                                 false);
47 }
48
49
50 void GPreamble::update()
51 {
52         disconnect_signals();
53         preamble()->get_buffer()->set_text(controller().params());
54         connect_signals();
55 }
56
57 void GPreamble::connect_signals()
58 {
59         slot_preamble_ = preamble()->
60                 get_buffer()->
61                 signal_changed().connect(SigC::slot(*this, &GPreamble::InputChanged));
62 }
63
64 void GPreamble::disconnect_signals()
65 {
66         slot_preamble_.disconnect();
67 }
68
69 Gtk::Button * GPreamble::ok_btn() const
70 {
71         return getWidget<Gtk::Button>("r_ok_btn");
72 }
73 Gtk::Button * GPreamble::apply_btn() const
74 {
75         return getWidget<Gtk::Button>("r_apply_btn");
76 }
77 Gtk::Button * GPreamble::cancel_btn() const
78 {
79         return getWidget<Gtk::Button>("r_cancel_btn");
80 }
81 Gtk::TextView * GPreamble::preamble() const
82 {
83         return getWidget<Gtk::TextView>("r_preamble");
84 }