diff options
| author | Ted Gould <ted@gould.cx> | 2008-02-29 23:00:42 +0000 |
|---|---|---|
| committer | gouldtj <gouldtj@users.sourceforge.net> | 2008-02-29 23:00:42 +0000 |
| commit | ed960c3bd3f9da273bbee59ee897ead529b41252 (patch) | |
| tree | 00ace3bb9dc6260a3516359907a49686d7832696 /src | |
| parent | r18223@shi: ted | 2008-02-29 14:22:41 -0800 (diff) | |
| download | inkscape-ed960c3bd3f9da273bbee59ee897ead529b41252.tar.gz inkscape-ed960c3bd3f9da273bbee59ee897ead529b41252.zip | |
r18225@shi: ted | 2008-02-29 14:40:32 -0800
Fix for LP: #181799
This makes it so that radio buttons cause events when changed, and thus
update with "Live Preview"
(bzr r4910)
Diffstat (limited to 'src')
| -rw-r--r-- | src/extension/paramradiobutton.cpp | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/src/extension/paramradiobutton.cpp b/src/extension/paramradiobutton.cpp index 5e8f20e52..5fce66910 100644 --- a/src/extension/paramradiobutton.cpp +++ b/src/extension/paramradiobutton.cpp @@ -180,18 +180,19 @@ private: ParamRadioButton * _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 put the radiobutton's string when it is selected. */ ParamRadioButtonWdg ( Gtk::RadioButtonGroup& group, const Glib::ustring& label, - ParamRadioButton * pref, SPDocument * doc, Inkscape::XML::Node * node ) : - Gtk::RadioButton(group, label), _pref(pref), _doc(doc), _node(node) { + ParamRadioButton * pref, SPDocument * doc, Inkscape::XML::Node * node, sigc::signal<void> * changeSignal ) : + Gtk::RadioButton(group, label), _pref(pref), _doc(doc), _node(node), _changeSignal(changeSignal) { add_changesignal(); }; ParamRadioButtonWdg ( const Glib::ustring& label, - ParamRadioButton * pref, SPDocument * doc, Inkscape::XML::Node * node ) : - Gtk::RadioButton(label), _pref(pref), _doc(doc), _node(node) { + ParamRadioButton * pref, SPDocument * doc, Inkscape::XML::Node * node , sigc::signal<void> * changeSignal) : + Gtk::RadioButton(label), _pref(pref), _doc(doc), _node(node), _changeSignal(changeSignal) { add_changesignal(); }; void add_changesignal() { @@ -212,6 +213,9 @@ ParamRadioButtonWdg::changed (void) Glib::ustring data = this->get_label(); _pref->set(data.c_str(), _doc, _node); } + if (_changeSignal != NULL) { + _changeSignal->emit(); + } } @@ -220,7 +224,7 @@ ParamRadioButtonWdg::changed (void) \brief Creates a combobox widget for an enumeration parameter */ Gtk::Widget * -ParamRadioButton::get_widget (SPDocument * doc, Inkscape::XML::Node * node, sigc::signal<void> * /*changeSignal*/) +ParamRadioButton::get_widget (SPDocument * doc, Inkscape::XML::Node * node, sigc::signal<void> * changeSignal) { Gtk::HBox * hbox = Gtk::manage(new Gtk::HBox(false, 4)); Gtk::VBox * vbox = Gtk::manage(new Gtk::VBox(false, 0)); @@ -238,11 +242,11 @@ ParamRadioButton::get_widget (SPDocument * doc, Inkscape::XML::Node * node, sigc optionentry * entr = reinterpret_cast<optionentry *>(list->data); Glib::ustring * text = entr->guitext; if (first) { - radio = Gtk::manage(new ParamRadioButtonWdg(*text, this, doc, node)); + radio = Gtk::manage(new ParamRadioButtonWdg(*text, this, doc, node, changeSignal)); group = radio->get_group(); first = false; } else { - radio = Gtk::manage(new ParamRadioButtonWdg(group, *text, this, doc, node)); + radio = Gtk::manage(new ParamRadioButtonWdg(group, *text, this, doc, node, changeSignal)); } radio->show(); vbox->pack_start(*radio, true, true); |
