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 "GViewBase.h"
15 #include "support/filetools.h"
22 GViewBase::GViewBase(Dialog & parent, string const & t, bool allowResize) :
23 Dialog::View(parent, t), allowResize_(allowResize)
28 GViewBase::~GViewBase()
33 void GViewBase::hide()
39 void GViewBase::build()
42 string const iconName =
43 support::LibFileSearch("images", "lyx", "xpm");
44 if (!iconName.empty())
45 window()->set_icon_from_file(iconName);
46 window()->signal_delete_event().connect(
47 sigc::mem_fun(*this, &GViewBase::onDeleteEvent));
48 window()->set_title(Glib::locale_to_utf8(getTitle()));
52 void GViewBase::show()
61 bool GViewBase::isVisible() const
63 return window() && window()->is_visible();
67 GBC & GViewBase::bcview()
69 return static_cast<GBC &>(dialog().bc().view());
73 void GViewBase::setCancel(Gtk::Button * cancel)
75 bcview().setCancel(cancel);
76 cancel->signal_clicked().connect(
77 sigc::mem_fun(*this, &GViewBase::onCancel));
81 void GViewBase::setApply(Gtk::Button * apply)
83 bcview().setApply(apply);
84 apply->signal_clicked().connect(
85 sigc::mem_fun(*this, &GViewBase::onApply));
89 void GViewBase::setOK(Gtk::Button * ok)
92 ok->signal_clicked().connect(
93 sigc::mem_fun(*this, &GViewBase::onOK));
97 void GViewBase::setRestore(Gtk::Button * restore)
99 bcview().setRestore(restore);
100 restore->signal_clicked().connect(
101 sigc::mem_fun(*this, &GViewBase::onRestore));
105 void GViewBase::onApply()
107 dialog().ApplyButton();
111 void GViewBase::onOK()
117 void GViewBase::onCancel()
119 dialog().CancelButton();
123 void GViewBase::onRestore()
125 dialog().RestoreButton();
129 bool GViewBase::onDeleteEvent(GdkEventAny *)
131 dialog().CancelButton();
136 GViewGladeB::GViewGladeB(Dialog & parent, string const & t, bool allowResize) :
137 GViewBase(parent, t, allowResize)
142 Gtk::Window * GViewGladeB::window()
147 xml_->get_widget("dialog", win);
152 Gtk::Window const * GViewGladeB::window() const
157 xml_->get_widget("dialog", win);
161 } // namespace frontend