*
* \author Huang Ying
*
- * Full author contact details are available in file CREDITS
+ * Full author contact details are available in file CREDITS.
*/
#include <config.h>
-#include <gtkmm.h>
+
+// Too hard to make concept checks work with this file
+#ifdef _GLIBCPP_CONCEPT_CHECKS
+#undef _GLIBCPP_CONCEPT_CHECKS
+#endif
#include "GViewBase.h"
-#include "ControlButtons.h"
#include "support/filetools.h"
+using std::string;
+
+namespace lyx {
+namespace frontend {
GViewBase::GViewBase(Dialog & parent, string const & t, bool allowResize) :
Dialog::View(parent, t), allowResize_(allowResize)
{
doBuild();
string const iconName =
- lyx::support::LibFileSearch("images", "lyx", "xpm");
+ support::LibFileSearch("images", "lyx", "xpm");
if (!iconName.empty())
window()->set_icon_from_file(iconName);
window()->signal_delete_event().connect(
- SigC::slot(*this, &GViewBase::onDeleteEvent));
+ sigc::mem_fun(*this, &GViewBase::onDeleteEvent));
window()->set_title(Glib::locale_to_utf8(getTitle()));
}
if (!window()) {
build();
}
+ update();
window()->show();
}
}
+void GViewBase::setCancel(Gtk::Button * cancel)
+{
+ bcview().setCancel(cancel);
+ cancel->signal_clicked().connect(
+ sigc::mem_fun(*this, &GViewBase::onCancel));
+}
+
+
+void GViewBase::setApply(Gtk::Button * apply)
+{
+ bcview().setApply(apply);
+ apply->signal_clicked().connect(
+ sigc::mem_fun(*this, &GViewBase::onApply));
+}
+
+
+void GViewBase::setOK(Gtk::Button * ok)
+{
+ bcview().setOK(ok);
+ ok->signal_clicked().connect(
+ sigc::mem_fun(*this, &GViewBase::onOK));
+}
+
+
+void GViewBase::setRestore(Gtk::Button * restore)
+{
+ bcview().setRestore(restore);
+ restore->signal_clicked().connect(
+ sigc::mem_fun(*this, &GViewBase::onRestore));
+}
+
+
+void GViewBase::setTitle(std::string const & title)
+{
+ Dialog::View::setTitle(title);
+ window()->set_title(title);
+}
+
+
+bool GViewBase::readOnly() const
+{
+ return kernel().isBufferReadonly();
+}
+
+
void GViewBase::onApply()
{
dialog().ApplyButton();
}
-const Gtk::Window * GViewGladeB::window() const
+Gtk::Window const * GViewGladeB::window() const
{
Gtk::Window * win;
if (!xml_)
xml_->get_widget("dialog", win);
return win;
}
+
+} // namespace frontend
+} // namespace lyx