]> git.lyx.org Git - lyx.git/blob - src/frontends/gtk/GBC.C
Add ShowFile dialog
[lyx.git] / src / frontends / gtk / GBC.C
1 /**
2  * \file GBC.C
3  * This file is part of LyX, the document processor.
4  * Licence details can be found in the file COPYING.
5  *
6  * \author Huang Ying
7  *
8  * Full author contact details are available in file CREDITS.
9  */
10
11 #include <config.h>
12
13 #include "GBC.h"
14
15 using std::string;
16
17 namespace lyx {
18 namespace frontend {
19
20 GBC::GBC(ButtonController const & parent,
21          string const & cancel, string const & close)
22         : GuiBC<Gtk::Button, Gtk::Widget>(parent, cancel, close)
23 {
24 }
25
26
27 void GBC::setButtonEnabled(Gtk::Button * btn, bool enabled) const
28 {
29         btn->set_sensitive(enabled);
30 }
31
32
33 void GBC::setWidgetEnabled(Gtk::Widget * widget, bool enabled) const
34 {
35         widget->set_sensitive(enabled);
36 }
37
38
39 void GBC::setButtonLabel(Gtk::Button * btn, string const & label) const
40 {
41         //GTK+ Stock buttons take precedence
42         if (!btn->get_use_stock())
43                 btn->set_label(Glib::locale_to_utf8(label));
44 }
45
46 } // namespace frontend
47 } // namespace lyx