diff options
| author | Johan B. C. Engelen <jbc.engelen@swissonline.ch> | 2008-01-16 20:12:15 +0000 |
|---|---|---|
| committer | johanengelen <johanengelen@users.sourceforge.net> | 2008-01-16 20:12:15 +0000 |
| commit | f47d8974f04de245c3eb52c549773599348b3d04 (patch) | |
| tree | 215f0f698b961f2eccb2ef5c4e5b27f9b9491a98 /src/live_effects | |
| parent | fix initialization of grid document properties (diff) | |
| download | inkscape-f47d8974f04de245c3eb52c549773599348b3d04.tar.gz inkscape-f47d8974f04de245c3eb52c549773599348b3d04.zip | |
RegisteredEnum is now subclassed from RegisteredWidget<enum> instead of old RegisteredWdg
(bzr r4523)
Diffstat (limited to 'src/live_effects')
| -rw-r--r-- | src/live_effects/lpe-curvestitch.cpp | 4 | ||||
| -rw-r--r-- | src/live_effects/lpe-pathalongpath.cpp | 2 | ||||
| -rw-r--r-- | src/live_effects/parameter/enum.h | 27 |
3 files changed, 13 insertions, 20 deletions
diff --git a/src/live_effects/lpe-curvestitch.cpp b/src/live_effects/lpe-curvestitch.cpp index 19513f531..de7d5ce7c 100644 --- a/src/live_effects/lpe-curvestitch.cpp +++ b/src/live_effects/lpe-curvestitch.cpp @@ -114,7 +114,7 @@ LPECurveStitch::doEffect_path (std::vector<Geom::Path> & path_in) transform.setTranslation( start ); Piecewise<D2<SBasis> > pwd2_out = (strokepath-stroke_origin) * transform; // add stuff to one big pw<d2<sbasis> > and then outside the loop convert to path? - std::vector<Path> result = Geom::path_from_piecewise(pwd2_out, LPE_CONVERSION_TOLERANCE); + std::vector<Geom::Path> result = Geom::path_from_piecewise(pwd2_out, LPE_CONVERSION_TOLERANCE); path_out[i] = result[0]; gdouble sv = spacing_variation; tA += incrementA * (1 + sv - spacing_variation.get_value()/2); @@ -140,7 +140,7 @@ LPECurveStitch::resetDefaults(SPItem * item) // set the stroke path to run horizontally in the middle of the bounding box of the original path Piecewise<D2<SBasis> > pwd2; - std::vector<Path> temppath = SVGD_to_2GeomPath( SP_OBJECT_REPR(item)->attribute("inkscape:original-d")); + std::vector<Geom::Path> temppath = SVGD_to_2GeomPath( SP_OBJECT_REPR(item)->attribute("inkscape:original-d")); for (unsigned int i=0; i < temppath.size(); i++) { pwd2.concat( temppath[i].toPwSb() ); } diff --git a/src/live_effects/lpe-pathalongpath.cpp b/src/live_effects/lpe-pathalongpath.cpp index ef6373274..b3d0fdd4c 100644 --- a/src/live_effects/lpe-pathalongpath.cpp +++ b/src/live_effects/lpe-pathalongpath.cpp @@ -179,7 +179,7 @@ LPEPathAlongPath::resetDefaults(SPItem * item) // set the bend path to run horizontally in the middle of the bounding box of the original path Piecewise<D2<SBasis> > pwd2; - std::vector<Path> temppath = SVGD_to_2GeomPath( SP_OBJECT_REPR(item)->attribute("inkscape:original-d")); + std::vector<Geom::Path> temppath = SVGD_to_2GeomPath( SP_OBJECT_REPR(item)->attribute("inkscape:original-d")); for (unsigned int i=0; i < temppath.size(); i++) { pwd2.concat( temppath[i].toPwSb() ); } diff --git a/src/live_effects/parameter/enum.h b/src/live_effects/parameter/enum.h index f0f3b59f8..1778af8f1 100644 --- a/src/live_effects/parameter/enum.h +++ b/src/live_effects/parameter/enum.h @@ -33,26 +33,22 @@ public: E default_value) : Parameter(label, tip, key, wr, effect) { - regenum = NULL; enumdataconv = &c; defvalue = default_value; value = defvalue; }; - virtual ~EnumParam() { - if (regenum) - delete regenum; - }; + + virtual ~EnumParam() { }; virtual Gtk::Widget * param_newWidget(Gtk::Tooltips * tooltips) { - // WIDGET TODO: This implementation is incorrect, it should create a *new* widget for the caller, not just return an already created widget - g_warning("EnumParam::param_newWidget still needs recoding to work with multiple document views"); - if (!regenum) { - regenum = new Inkscape::UI::Widget::RegisteredEnum<E>(); - regenum->init(param_label, param_tooltip, param_key, *enumdataconv, *param_wr, param_effect->getRepr(), param_effect->getSPDoc()); - regenum->combobox()->set_active_by_id(value); - regenum->set_undo_parameters(SP_VERB_DIALOG_LIVE_PATH_EFFECT, _("Change enum parameter")); - } - return dynamic_cast<Gtk::Widget *> (regenum->labelled); + Inkscape::UI::Widget::RegisteredEnum<E> *regenum = Gtk::manage ( + new Inkscape::UI::Widget::RegisteredEnum<E>( param_label, param_tooltip, + param_key, *enumdataconv, *param_wr, param_effect->getRepr(), param_effect->getSPDoc() ) ); + + regenum->set_active_by_id(value); + regenum->set_undo_parameters(SP_VERB_DIALOG_LIVE_PATH_EFFECT, _("Change enum parameter")); + + return dynamic_cast<Gtk::Widget *> (regenum); }; bool param_readSVGValue(const gchar * strvalue) { @@ -80,15 +76,12 @@ public: void param_set_value(E val) { value = val; - if (regenum) - regenum->combobox()->set_active_by_id(value); } private: EnumParam(const EnumParam&); EnumParam& operator=(const EnumParam&); - UI::Widget::RegisteredEnum<E> * regenum; E value; E defvalue; |
