summaryrefslogtreecommitdiffstats
path: root/src/ui/widget
diff options
context:
space:
mode:
authorJohn Smith <john.smith7545@yahoo.com>2012-03-23 02:53:58 +0000
committerJohn Smith <removethis.john.q.public@bigmail.com>2012-03-23 02:53:58 +0000
commit924e671a1e5d76c1d25d4fcad9d0e9f015dc394e (patch)
treeb5edc420bece6f3a7227bdb1009af3fea51388b9 /src/ui/widget
parentUI. Patch for Bug #666370 (Not all units in the Object Transform dialog are t... (diff)
downloadinkscape-924e671a1e5d76c1d25d4fcad9d0e9f015dc394e.tar.gz
inkscape-924e671a1e5d76c1d25d4fcad9d0e9f015dc394e.zip
Fix for 909328 : Dockable Find & Replace dialog
(bzr r11117)
Diffstat (limited to 'src/ui/widget')
-rw-r--r--src/ui/widget/button.cpp16
-rw-r--r--src/ui/widget/button.h14
-rw-r--r--src/ui/widget/entry.cpp9
-rw-r--r--src/ui/widget/entry.h46
4 files changed, 84 insertions, 1 deletions
diff --git a/src/ui/widget/button.cpp b/src/ui/widget/button.cpp
index 1ba531ddf..bac866920 100644
--- a/src/ui/widget/button.cpp
+++ b/src/ui/widget/button.cpp
@@ -31,6 +31,22 @@ CheckButton::CheckButton(Glib::ustring const &label, Glib::ustring const &toolti
set_tooltip_text(tooltip);
}
+CheckButton::CheckButton(Glib::ustring const &label, Glib::ustring const &tooltip, bool active)
+{
+ set_use_underline (true);
+ set_label (label);
+ set_tooltip_text(tooltip);
+ set_active(active);
+}
+
+RadioButton::RadioButton(Glib::ustring const &label, Glib::ustring const &tooltip)
+{
+ set_use_underline (true);
+ set_label (label);
+ set_tooltip_text(tooltip);
+}
+
+
} // namespace Widget
} // namespace UI
} // namespace Inkscape
diff --git a/src/ui/widget/button.h b/src/ui/widget/button.h
index 362cdf8ff..b219fc3db 100644
--- a/src/ui/widget/button.h
+++ b/src/ui/widget/button.h
@@ -11,6 +11,7 @@
#define INKSCAPE_UI_WIDGET_BUTTON_H
#include <gtkmm/checkbutton.h>
+#include <gtkmm/radiobutton.h>
namespace Inkscape {
namespace UI {
@@ -34,6 +35,19 @@ class CheckButton : public Gtk::CheckButton
public:
CheckButton();
CheckButton(Glib::ustring const &label, Glib::ustring const &tooltip);
+ CheckButton(Glib::ustring const &label, Glib::ustring const &tooltip, bool active);
+
+};
+
+/**
+ * RadioButton widget.
+ */
+class RadioButton : public Gtk::RadioButton
+{
+public:
+ RadioButton();
+ RadioButton(Glib::ustring const &label, Glib::ustring const &tooltip);
+
};
} // namespace Widget
diff --git a/src/ui/widget/entry.cpp b/src/ui/widget/entry.cpp
index 7ac8532fb..08617433c 100644
--- a/src/ui/widget/entry.cpp
+++ b/src/ui/widget/entry.cpp
@@ -24,7 +24,14 @@ Entry::Entry( Glib::ustring const &label, Glib::ustring const &tooltip,
: Labelled(label, tooltip, new Gtk::Entry(), suffix, icon, mnemonic)
{
}
-
+
+ComboBoxText::ComboBoxText( Glib::ustring const &label, Glib::ustring const &tooltip,
+ Glib::ustring const &suffix,
+ Glib::ustring const &icon,
+ bool mnemonic)
+ : Labelled(label, tooltip, new Gtk::ComboBoxText(true), suffix, icon, mnemonic)
+{
+}
} // namespace Widget
} // namespace UI
diff --git a/src/ui/widget/entry.h b/src/ui/widget/entry.h
index d332dde1b..be7c8b450 100644
--- a/src/ui/widget/entry.h
+++ b/src/ui/widget/entry.h
@@ -11,8 +11,10 @@
#define INKSCAPE_UI_WIDGET_ENTRY__H
#include "labelled.h"
+#include <gtkmm.h>
#include <gtkmm/entry.h>
+#include <gtkmm/comboboxtext.h>
namespace Inkscape {
namespace UI {
@@ -35,6 +37,50 @@ public:
Gtk::Entry* getEntry() {return (Gtk::Entry*)(_widget);};
};
+class ComboBoxText : public Labelled
+{
+public:
+ ComboBoxText( Glib::ustring const &label,
+ Glib::ustring const &tooltip,
+ Glib::ustring const &suffix = "",
+ Glib::ustring const &icon = "",
+ bool mnemonic = true);
+
+ Gtk::ComboBoxText* getWidget() { return (Gtk::ComboBoxText *)_widget; };
+ Gtk::Entry* getEntry() { return (Gtk::Entry *)getWidget()->get_child(); };
+ Glib::ustring get_text() { return getEntry()->get_text(); };
+ void prepend_text(const Glib::ustring& text) {
+#if WITH_GTKMM_2_24
+ getWidget()->prepend(text);
+#else
+ getWidget()->prepend_text(text);
+#endif
+ };
+ void append_text(const Glib::ustring& text) {
+#if WITH_GTKMM_2_24
+ getWidget()->append(text);
+#else
+ getWidget()->append_text(text);
+#endif
+ };
+ void insert_text(gint position, const Glib::ustring& text) {
+#if WITH_GTKMM_2_24
+ getWidget()->insert(position, text);
+#else
+ getWidget()->insert_text(position, text);
+#endif
+ };
+ void remove_text(const Glib::ustring& text) { getWidget()->remove_text(text); };
+ void remove_all() {
+#if WITH_GTKMM_2_24
+ getWidget()->remove_all();
+#else
+ getWidget()->clear_items();
+#endif
+ };
+
+};
+
} // namespace Widget
} // namespace UI
} // namespace Inkscape