Use link_count from children vocabulary and return the stored vocabulary if already...
[synfig.git] / synfig-core / src / synfig / valuenode_duplicate.cpp
index 540c3a9..b3e88aa 100644 (file)
@@ -58,6 +58,8 @@ ValueNode_Duplicate::ValueNode_Duplicate(const ValueBase::Type &x):
 ValueNode_Duplicate::ValueNode_Duplicate(const ValueBase &x):
        LinkableValueNode(x.get_type())
 {
+       Vocab ret(get_children_vocab());
+       set_children_vocab(ret);
        set_link("from", ValueNode_Const::create(Real(1.0)));
        set_link("to",   ValueNode_Const::create(x.get(Real())));
        set_link("step", ValueNode_Const::create(Real(1.0)));
@@ -215,3 +217,29 @@ ValueNode_Duplicate::check_type(ValueBase::Type type __attribute__ ((unused)))
        // never offer this as a choice.  it's used automatically by the 'Duplicate' layer.
        return false;
 }
+
+LinkableValueNode::Vocab
+ValueNode_Duplicate::get_children_vocab_vfunc()const
+{
+       if(children_vocab.size())
+               return children_vocab;
+
+       LinkableValueNode::Vocab ret;
+
+       ret.push_back(ParamDesc(ValueBase(),"from")
+               .set_local_name(_("From"))
+               .set_description(_("Initial value of the index "))
+       );
+
+       ret.push_back(ParamDesc(ValueBase(),"to")
+               .set_local_name(_("To"))
+               .set_description(_("Final value of the index"))
+       );
+
+       ret.push_back(ParamDesc(ValueBase(),"step")
+               .set_local_name(_("Step"))
+               .set_description(_("Amount increment of the index"))
+       );
+
+       return ret;
+}