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()
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