Code

New widget helperclass for Gtk:Entry
authorjohanengelen <johanengelen@users.sourceforge.net>
Wed, 29 Nov 2006 02:16:02 +0000 (02:16 +0000)
committerjohanengelen <johanengelen@users.sourceforge.net>
Wed, 29 Nov 2006 02:16:02 +0000 (02:16 +0000)
src/ui/widget/Makefile_insert
src/ui/widget/entry.cpp [new file with mode: 0644]
src/ui/widget/entry.h [new file with mode: 0644]

index 2ef0f8f419d539006136c118b8273726298ad769..d84cb2f97d283b1e6644315ccac72a76c72c026a 100644 (file)
@@ -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 (file)
index 0000000..73a5eda
--- /dev/null
@@ -0,0 +1,35 @@
+/** \file\r
+ *\r
+ * \brief Helperclass for Gtk::Entry widgets\r
+ *\r
+ * Authors:\r
+ *   Johan Engelen <goejendaagh@zonnet.nl>\r
+ *\r
+ * Copyright (C) 2006 Authors\r
+ *\r
+ * Released under GNU GPL.  Read the file 'COPYING' for more information\r
+ */\r
+\r
+#ifdef HAVE_CONFIG_H\r
+# include <config.h>\r
+#endif\r
+\r
+#include "entry.h"\r
+\r
+namespace Inkscape {\r
+namespace UI {\r
+namespace Widget {\r
+\r
+Entry::Entry(Glib::ustring const &label, Glib::ustring const &tooltip)\r
+    : _label(label, true), _entry(), _tooltips()\r
+{\r
+    pack_start(_label);\r
+    pack_start(_entry);\r
+    \r
+    _tooltips.set_tip(*this, tooltip);\r
+}\r
+\r
+} // namespace Widget\r
+} // namespace UI\r
+} // namespace Inkscape\r
+\r
diff --git a/src/ui/widget/entry.h b/src/ui/widget/entry.h
new file mode 100644 (file)
index 0000000..3ed4d66
--- /dev/null
@@ -0,0 +1,42 @@
+/** \file \r
+ *\r
+ * \brief Helperclass for Gtk::Entry widgets\r
+ *\r
+ * Authors:\r
+ *   Johan Engelen <goejendaagh@zonnet.nl>\r
+ *\r
+ * Copyright (C) 2006 Authors\r
+ *\r
+ * Released under GNU GPL.  Read the file 'COPYING' for more information.\r
+ */\r
+\r
+#ifndef INKSCAPE_UI_WIDGET_ENTRY__H\r
+#define INKSCAPE_UI_WIDGET_ENTRY__H\r
+\r
+#include <gtkmm/entry.h>\r
+#include <gtkmm/tooltips.h>\r
+#include <gtkmm/label.h>\r
+#include <gtkmm/box.h>\r
+\r
+namespace Inkscape {\r
+namespace UI {\r
+namespace Widget {\r
+\r
+class Entry : public Gtk::HBox\r
+{\r
+public:\r
+    Entry(Glib::ustring const &label, Glib::ustring const &tooltip);\r
+        \r
+    // TO DO: add methods to access _entry    \r
+        \r
+protected:\r
+    Gtk::Tooltips _tooltips;\r
+    Gtk::Label    _label;\r
+    Gtk::Entry    _entry;\r
+};\r
+\r
+} // namespace Widget\r
+} // namespace UI\r
+} // namespace Inkscape\r
+\r
+#endif // INKSCAPE_UI_WIDGET_ENTRY__H\r