Use link_count from children vocabulary and return the stored vocabulary if already...
[synfig.git] / synfig-core / src / synfig / valuenode_realstring.cpp
index e8231e7..cb0f4e6 100644 (file)
@@ -54,6 +54,8 @@ using namespace synfig;
 ValueNode_RealString::ValueNode_RealString(const ValueBase &value):
        LinkableValueNode(value.get_type())
 {
+       Vocab ret(get_children_vocab());
+       set_children_vocab(ret);
        switch(value.get_type())
        {
        case ValueBase::TYPE_STRING:
@@ -65,8 +67,6 @@ ValueNode_RealString::ValueNode_RealString(const ValueBase &value):
        default:
                throw Exception::BadType(ValueBase::type_local_name(value.get_type()));
        }
-
-       DCAST_HACK_ENABLE();
 }
 
 LinkableValueNode*
@@ -208,3 +208,35 @@ ValueNode_RealString::check_type(ValueBase::Type type)
        return
                type==ValueBase::TYPE_STRING;
 }
+
+LinkableValueNode::Vocab
+ValueNode_RealString::get_children_vocab_vfunc()const
+{
+       if(children_vocab.size())
+               return children_vocab;
+
+       LinkableValueNode::Vocab ret;
+
+       ret.push_back(ParamDesc(ValueBase(),"real")
+               .set_local_name(_("Real"))
+               .set_description(_("Value to convert to string"))
+       );
+
+       ret.push_back(ParamDesc(ValueBase(),"width")
+               .set_local_name(_("Width"))
+               .set_description(_("Width of the string"))
+       );
+
+       ret.push_back(ParamDesc(ValueBase(),"precision")
+               .set_local_name(_("Precision"))
+               .set_description(_("Number of decimal places"))
+       );
+
+       ret.push_back(ParamDesc(ValueBase(),"zero_pad")
+               .set_local_name(_("Zero Padded"))
+               .set_description(_("When checked, the string is left filled with zeros to match the width"))
+       );
+
+
+       return ret;
+}