summaryrefslogtreecommitdiffstats
path: root/src/extension/paramenum.cpp
diff options
context:
space:
mode:
authorTed Gould <ted@gould.cx>2007-08-10 17:38:51 +0000
committergouldtj <gouldtj@users.sourceforge.net>2007-08-10 17:38:51 +0000
commitb29eafffd0b92cc7b67e5cd877aad5e98b0f0231 (patch)
tree167c348e5e11ebf3d8afec37593f023180675039 /src/extension/paramenum.cpp
parentfix 1767940 (diff)
downloadinkscape-b29eafffd0b92cc7b67e5cd877aad5e98b0f0231.tar.gz
inkscape-b29eafffd0b92cc7b67e5cd877aad5e98b0f0231.zip
r16217@tres: ted | 2007-08-10 10:36:27 -0700
ImageMagick effects patch from Chris Brown. Google Summer of Code project. (bzr r3450)
Diffstat (limited to '')
-rw-r--r--src/extension/paramenum.cpp22
1 files changed, 15 insertions, 7 deletions
diff --git a/src/extension/paramenum.cpp b/src/extension/paramenum.cpp
index 8aea1daeb..8d779d1c2 100644
--- a/src/extension/paramenum.cpp
+++ b/src/extension/paramenum.cpp
@@ -155,6 +155,11 @@ ParamComboBox::set (const gchar * in, SPDocument * doc, Inkscape::XML::Node * no
return _value;
}
+void
+ParamComboBox::changed (void) {
+
+}
+
/**
\brief A function to get the value of the parameter in string form
@@ -168,19 +173,23 @@ ParamComboBox::string (void)
return param_string;
}
+
+
+
/** \brief A special category of Gtk::Entry to handle string parameteres */
class ParamComboBoxEntry : public Gtk::ComboBoxText {
private:
ParamComboBox * _pref;
SPDocument * _doc;
Inkscape::XML::Node * _node;
+ sigc::signal<void> * _changeSignal;
public:
/** \brief Build a string preference for the given parameter
\param pref Where to get the string from, and where to put it
when it changes.
*/
- ParamComboBoxEntry (ParamComboBox * pref, SPDocument * doc, Inkscape::XML::Node * node) :
- Gtk::ComboBoxText(), _pref(pref), _doc(doc), _node(node) {
+ ParamComboBoxEntry (ParamComboBox * pref, SPDocument * doc, Inkscape::XML::Node * node, sigc::signal<void> * changeSignal) :
+ Gtk::ComboBoxText(), _pref(pref), _doc(doc), _node(node), _changeSignal(changeSignal) {
this->signal_changed().connect(sigc::mem_fun(this, &ParamComboBoxEntry::changed));
};
void changed (void);
@@ -196,11 +205,11 @@ ParamComboBoxEntry::changed (void)
{
Glib::ustring data = this->get_active_text();
_pref->set(data.c_str(), _doc, _node);
- return;
+ if (_changeSignal != NULL) {
+ _changeSignal->emit();
+ }
}
-
-
/**
\brief Creates a combobox widget for an enumeration parameter
*/
@@ -213,7 +222,7 @@ ParamComboBox::get_widget (SPDocument * doc, Inkscape::XML::Node * node, sigc::s
label->show();
hbox->pack_start(*label, false, false);
- ParamComboBoxEntry * combo = Gtk::manage(new ParamComboBoxEntry(this, doc, node));
+ ParamComboBoxEntry * combo = Gtk::manage(new ParamComboBoxEntry(this, doc, node, changeSignal));
// add choice strings:
Glib::ustring * settext = 0;
for (GSList * list = choices; list != NULL; list = g_slist_next(list)) {
@@ -237,4 +246,3 @@ ParamComboBox::get_widget (SPDocument * doc, Inkscape::XML::Node * node, sigc::s
} /* namespace Extension */
} /* namespace Inkscape */
-