Default Child Container

Default Child Container specifies the default parent for children of the selected component.

By default this value is blank, which means that newly added children treat the entire component as their parent. If this value is set, children which are dropped on instances of this component type use the instance as their parent.

Default Child Container is typically set on containers which are designed to hold children, but which have margins or decoration around the dedicated container instance. Examples include list boxes, tree views, and frames.

Example

Consider a Component named Frame which has two instances: OuterRectangle and InnerRectangle.

Frame component with two children

This Component is designed to keep all of is children inside the InnerRectangle, so that any child automatically respects the margin specified by InnerRectangle.

To make this kind of relationship the default, the Frame can set its Default Child Container property to InnerRectangle.

Setting the Default Child Container

Once this value is set, instances which are drag+dropped onto Frame instances use the InnerRectangle as their parent, as shown in the following animation.

Adding a child automatically uses the Default Child Container

Parent Details

When one instance is drag+dropped onto another instance, the Parent property is set according to the parent's Default Child Container.

Using the example above, the RectangleInstance is dropped on the ContainerTestInstance. Since the ContainerTestInstance is of type Frame, then the Default Child Container is applied on the drop, which results in the RectangleInstance's Parent being set to ContainerTestInstance.InnerRectangle.

Ignoring Default Child Container

As mentioned above, if an instance is added to a parent component, the instance automatically attaches itself to the parent's Default Child Container. This can be undone by manually changing the Parent property.

For example, the Parent can be manually changed to ContainerTestInstance.

Changing the Parent to the name of the instance can force a child to be attached to the root of the parent

Last updated

Was this helpful?