From 9778e170b43ef3ab1416d84092061ff7d29325e3 Mon Sep 17 00:00:00 2001 From: johanengelen Date: Wed, 29 Nov 2006 02:16:02 +0000 Subject: [PATCH] New widget helperclass for Gtk:Entry --- src/ui/widget/Makefile_insert | 2 ++ src/ui/widget/entry.cpp | 35 +++++++++++++++++++++++++++++ src/ui/widget/entry.h | 42 +++++++++++++++++++++++++++++++++++ 3 files changed, 79 insertions(+) create mode 100644 src/ui/widget/entry.cpp create mode 100644 src/ui/widget/entry.h diff --git a/src/ui/widget/Makefile_insert b/src/ui/widget/Makefile_insert index 2ef0f8f41..d84cb2f97 100644 --- a/src/ui/widget/Makefile_insert +++ b/src/ui/widget/Makefile_insert @@ -16,6 +16,8 @@ ui_widget_libuiwidget_a_SOURCES = \ ui/widget/combo-text.h \ ui/widget/entity-entry.cpp \ ui/widget/entity-entry.h \ + ui/widget/entry.cpp \ + ui/widget/entry.h \ ui/widget/handlebox.cpp \ ui/widget/handlebox.h \ ui/widget/icon-widget.cpp \ diff --git a/src/ui/widget/entry.cpp b/src/ui/widget/entry.cpp new file mode 100644 index 000000000..73a5edac1 --- /dev/null +++ b/src/ui/widget/entry.cpp @@ -0,0 +1,35 @@ +/** \file + * + * \brief Helperclass for Gtk::Entry widgets + * + * Authors: + * Johan Engelen + * + * Copyright (C) 2006 Authors + * + * Released under GNU GPL. Read the file 'COPYING' for more information + */ + +#ifdef HAVE_CONFIG_H +# include +#endif + +#include "entry.h" + +namespace Inkscape { +namespace UI { +namespace Widget { + +Entry::Entry(Glib::ustring const &label, Glib::ustring const &tooltip) + : _label(label, true), _entry(), _tooltips() +{ + pack_start(_label); + pack_start(_entry); + + _tooltips.set_tip(*this, tooltip); +} + +} // namespace Widget +} // namespace UI +} // namespace Inkscape + diff --git a/src/ui/widget/entry.h b/src/ui/widget/entry.h new file mode 100644 index 000000000..3ed4d661e --- /dev/null +++ b/src/ui/widget/entry.h @@ -0,0 +1,42 @@ +/** \file + * + * \brief Helperclass for Gtk::Entry widgets + * + * Authors: + * Johan Engelen + * + * Copyright (C) 2006 Authors + * + * Released under GNU GPL. Read the file 'COPYING' for more information. + */ + +#ifndef INKSCAPE_UI_WIDGET_ENTRY__H +#define INKSCAPE_UI_WIDGET_ENTRY__H + +#include +#include +#include +#include + +namespace Inkscape { +namespace UI { +namespace Widget { + +class Entry : public Gtk::HBox +{ +public: + Entry(Glib::ustring const &label, Glib::ustring const &tooltip); + + // TO DO: add methods to access _entry + +protected: + Gtk::Tooltips _tooltips; + Gtk::Label _label; + Gtk::Entry _entry; +}; + +} // namespace Widget +} // namespace UI +} // namespace Inkscape + +#endif // INKSCAPE_UI_WIDGET_ENTRY__H -- 2.30.2