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 "ControlButtons.h"
16 #include "support/filetools.h"
19 GViewBase::GViewBase(Dialog & parent, string const & t, bool allowResize) :
20 Dialog::View(parent, t), allowResize_(allowResize)
25 GViewBase::~GViewBase()
30 void GViewBase::hide()
36 void GViewBase::build()
39 string const iconName =
40 lyx::support::LibFileSearch("images", "lyx", "xpm");
41 if (!iconName.empty())
42 window()->set_icon_from_file(iconName);
43 window()->signal_delete_event().connect(
44 SigC::slot(*this, &GViewBase::onDeleteEvent));
45 window()->set_title(Glib::locale_to_utf8(getTitle()));
49 void GViewBase::show()
58 bool GViewBase::isVisible() const
60 return window() && window()->is_visible();
64 GBC & GViewBase::bcview()
66 return static_cast<GBC &>(dialog().bc().view());
70 void GViewBase::onApply()
72 dialog().ApplyButton();
76 void GViewBase::onOK()
82 void GViewBase::onCancel()
84 dialog().CancelButton();
88 void GViewBase::onRestore()
90 dialog().RestoreButton();
94 bool GViewBase::onDeleteEvent(GdkEventAny *)
96 dialog().CancelButton();
101 GViewGladeB::GViewGladeB(Dialog & parent, string const & t, bool allowResize) :
102 GViewBase(parent, t, allowResize)
107 Gtk::Window * GViewGladeB::window()
112 xml_->get_widget("dialog", win);
117 const Gtk::Window * GViewGladeB::window() const
122 xml_->get_widget("dialog", win);