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 #include "GViewBase.h"
14 #include "support/filetools.h"
21 GViewBase::GViewBase(Dialog & parent, string const & t, bool allowResize) :
22 Dialog::View(parent, t), allowResize_(allowResize)
27 GViewBase::~GViewBase()
32 void GViewBase::hide()
38 void GViewBase::build()
41 string const iconName =
42 support::LibFileSearch("images", "lyx", "xpm");
43 if (!iconName.empty())
44 window()->set_icon_from_file(iconName);
45 window()->signal_delete_event().connect(
46 sigc::mem_fun(*this, &GViewBase::onDeleteEvent));
47 window()->set_title(Glib::locale_to_utf8(getTitle()));
51 void GViewBase::show()
60 bool GViewBase::isVisible() const
62 return window() && window()->is_visible();
66 GBC & GViewBase::bcview()
68 return static_cast<GBC &>(dialog().bc().view());
72 void GViewBase::setCancel(Gtk::Button * cancel)
74 bcview().setCancel(cancel);
75 cancel->signal_clicked().connect(
76 sigc::mem_fun(*this, &GViewBase::onCancel));
80 void GViewBase::setApply(Gtk::Button * apply)
82 bcview().setApply(apply);
83 apply->signal_clicked().connect(
84 sigc::mem_fun(*this, &GViewBase::onApply));
88 void GViewBase::setOK(Gtk::Button * ok)
91 ok->signal_clicked().connect(
92 sigc::mem_fun(*this, &GViewBase::onOK));
96 void GViewBase::setRestore(Gtk::Button * restore)
98 bcview().setRestore(restore);
99 restore->signal_clicked().connect(
100 sigc::mem_fun(*this, &GViewBase::onRestore));
104 void GViewBase::onApply()
106 dialog().ApplyButton();
110 void GViewBase::onOK()
116 void GViewBase::onCancel()
118 dialog().CancelButton();
122 void GViewBase::onRestore()
124 dialog().RestoreButton();
128 bool GViewBase::onDeleteEvent(GdkEventAny *)
130 dialog().CancelButton();
135 GViewGladeB::GViewGladeB(Dialog & parent, string const & t, bool allowResize) :
136 GViewBase(parent, t, allowResize)
141 Gtk::Window * GViewGladeB::window()
146 xml_->get_widget("dialog", win);
151 Gtk::Window const * GViewGladeB::window() const
156 xml_->get_widget("dialog", win);
160 } // namespace frontend