IRelativeLayout::SetConstraint method

bool SetConstraint(ILayoutNode*pNodeFrom, ConstraintTypeconstraintFrom, ILayoutNode*pNodeTo, ConstraintTypeconstraintTo, intnModifier, floatfModifier)

Defines a constraint on a child node of this node.

Defined in: RelativeLayout.h

Return Value

true if application of the constraint can be performed successfully, false otherwise.

Parameters

pNodeFrom

Node the constraint will be applied to.

constraintFrom

Constraint to be applied against pNodeFrom. Takes a value from the  ConstraintType enumeration.

pNodeTo

Node relative to which the constraint will be applied.

constraintTo

Constraint to be applied relative to pNodeTo. Takes a value from the  ConstraintType enumeration. Default is RelDefault.

nModifier

Additive modifier, usually used to indicate a positive or negative displacement. Default is 0.

fModifier

Multiplicative modifier, usually used to scale the effect of the constraint. Default is 1.0.

Example

This example says: "Set the left side of the node pSplitter to the right side of the pNameNode node plus 20 units."

pRelative-&gtSetConstraint(pSplitter, RelLeft, pNameNode, RelRight, 20);&ltnl>
This example says: "Move (without resizing it) the node pOkNode, such that its bottom is 30 pixels up of the Root node bottom."

pRelative-&gtSetConstraint(pOkNode, foundation::RelMoveBottom, pRootNode, foundation::RelBottom, -30);&ltnl>