diff options
| author | Johan B. C. Engelen <jbc.engelen@swissonline.ch> | 2008-01-15 14:29:14 +0000 |
|---|---|---|
| committer | johanengelen <johanengelen@users.sourceforge.net> | 2008-01-15 14:29:14 +0000 |
| commit | 63273692c4e638b46a9e84026f62721784ec2cb4 (patch) | |
| tree | dbeabf7fddd50b809fee9384643a636c0a36438b /src/live_effects/effect.cpp | |
| parent | M AUTHORS (diff) | |
| download | inkscape-63273692c4e638b46a9e84026f62721784ec2cb4.tar.gz inkscape-63273692c4e638b46a9e84026f62721784ec2cb4.zip | |
prepare LPE parameter widgets to be owned by multiple dialogs, as it should be.
For each parameter function that has not been re-implemented, a warning is issued.
Sorry for the huge number of warnings showing when working with LPE. It is important to fix this asap.
(bzr r4495)
Diffstat (limited to 'src/live_effects/effect.cpp')
| -rw-r--r-- | src/live_effects/effect.cpp | 45 |
1 files changed, 20 insertions, 25 deletions
diff --git a/src/live_effects/effect.cpp b/src/live_effects/effect.cpp index 543d60fc0..bdbc4dd52 100644 --- a/src/live_effects/effect.cpp +++ b/src/live_effects/effect.cpp @@ -98,17 +98,12 @@ Effect::New(EffectType lpenr, LivePathEffectObject *lpeobj) Effect::Effect(LivePathEffectObject *lpeobject) { - vbox = NULL; - tooltips = NULL; lpeobj = lpeobject; oncanvasedit_it = 0; } Effect::~Effect() { - if (tooltips) { - delete tooltips; - } } Glib::ustring @@ -236,30 +231,30 @@ Effect::registerParameter(Parameter * param) param_vector.push_back(param); } +/** +* This *creates* a new widget, management of deletion should be done by the caller +*/ Gtk::Widget * -Effect::getWidget() +Effect::newWidget(Gtk::Tooltips * tooltips) { - if (!vbox) { - vbox = Gtk::manage( new Gtk::VBox() ); // use manage here, because after deletion of Effect object, others might still be pointing to this widget. - //if (!tooltips) - tooltips = new Gtk::Tooltips(); - - vbox->set_border_width(5); - - std::vector<Parameter *>::iterator it = param_vector.begin(); - while (it != param_vector.end()) { - Parameter * param = *it; - Gtk::Widget * widg = param->param_getWidget(); - Glib::ustring * tip = param->param_getTooltip(); - if (widg) { - vbox->pack_start(*widg, true, true, 2); - if (tip != NULL) { - tooltips->set_tip(*widg, *tip); - } - } + // use manage here, because after deletion of Effect object, others might still be pointing to this widget. + Gtk::VBox * vbox = Gtk::manage( new Gtk::VBox() ); - it++; + vbox->set_border_width(5); + + std::vector<Parameter *>::iterator it = param_vector.begin(); + while (it != param_vector.end()) { + Parameter * param = *it; + Gtk::Widget * widg = param->param_newWidget(tooltips); + Glib::ustring * tip = param->param_getTooltip(); + if (widg) { + vbox->pack_start(*widg, true, true, 2); + if (tip != NULL) { + tooltips->set_tip(*widg, *tip); + } } + + it++; } return dynamic_cast<Gtk::Widget *>(vbox); |
