Parent and children: how to improve their relationship

  • Dear Klaus,

    The introduction of parent and children is very beautiful. Thank you very much for this!

    Its possibilities would become very much increased if we also had a way to distinguish, when we change the value of a property, if it should also affect the children of the object, or not. And also a way to change the value of the children, but not the parent itself.

    Probably this is not so hard for you to implement - however, it is not so easy to figure out a syntax which could indicate in the code if our changing a property should be limited to the parent itself, or should include the children, or should only affect the children. This syntax should be backward compatible, and should seem logical.

    I can see that you have been thinking about the same problem when you introduced "scalechildren". This property would not be needed if we had a way to indicate if any changing of a value should be limited to the parent or not.

    To illustrate my point, let's say that we agree that:

    • if we put a # prefix in front of a value, then it means the operation is limited to the parent;
    • if we put a ~ prefix in front of a value, then it means the operation is limited to the children, and not the parent;
    • if we put no prefix, then the standard behavior happens: the operation affects parent and its children.


    Then scale="#0.5" would mean the parent gets scaled, but the scaling of the children would remain unaffected. And there would be no need for scalechildren="false".

    And visible="~false" would mean the children become hidden, but the parent remains unaffected.

    Of course, this should not be limited to booleans, but should also work for numbers and strings.

    Now I'm not saying that this # and ~ is such a great idea (they are neither backward compatible, nor logical), I just meant to illustrate the effect, not the means. I hope I'm making sense.

    So if anyone knows a nice syntax that could be used for indicating if changing a value should affect the parent only, or the children only, please step forward *smile*. It should obey the rules of xml, and should be backward compatible.

    Thank you.


    PS. I came up with this idea after I noticed that making invisible parents just so that one can control all children at once, comes with a speed penalty. Just try the following (a suitable invisible parent for all controls on the screen), and you will see that autorotation becomes incredibly slow and jumpy:

    Code
    <plugin name="ParentForMyControls"
    		url="spacer.gif" 
    		width="100%"
    		height="100%"
    		handcursor="false"
    	/>


    So here it would help to make it invisible, but of course I want to make its children visible or invisible without making the parent visible.

    - Ronny D'Hoore

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!