Python Reference Guide
FBConstraintRelation Class Reference

ConstraintRelation class. More...

Public Member Functions

tuple< bool, int, intGetBoxPosition ()
 Get a box position in the GUI. More...
 
 FBConstraintRelation (str pName)
 Constructor. More...
 
FBBox ConstrainObject (FBBox pConstrainedObject)
 Create a receiver box. More...
 
FBBox CreateFunctionBox (str pGroup, str pName)
 Create a function box. More...
 
FBBox SetAsSource (FBBox pSource)
 Create a sender box. More...
 
bool SetBoxPosition (FBBox pBox, int pX, int pY)
 Set a box position in the GUI. More...
 

Public Attributes

FBListBox Boxes
 List: Boxes used in this constraint.
More...
 

Detailed Description

ConstraintRelation class.


This class exposes the relation constraint and allows addition of new boxes and removal of existing ones.

See sample: TraversingRelationConstraint.py.

Constructor & Destructor Documentation

◆ FBConstraintRelation()

Constructor.

Parameters
pNameName of constraint.

Member Function Documentation

◆ ConstrainObject()

FBBox ConstrainObject ( FBBox  pConstrainedObject)

Create a receiver box.

Use an existing FBBox object to create a receiver in the relation.

Parameters
pConstrainedObjectDestination box to insert in the constraint.
Returns
A place holder box for the object.

◆ CreateFunctionBox()

FBBox CreateFunctionBox ( str  pGroup,
str  pName 
)

Create a function box.

Ask the constraint to create new function box.

Parameters
pGroupName of the group under which the function is located in the Constraint Relation GUI (case-sensitive!).
pNameName of the function, as seen in the GUI (case-sensitive!).
Returns
The newly created function box, or NULL if the name/group combination was invalid.

◆ GetBoxPosition()

tuple<bool, int, int> GetBoxPosition ( )

Get a box position in the GUI.

Get the position of a box within the constraint layout view.

Returns
A tuple containing: the result of operation (bool), X value (int), and Y value(int)

◆ SetAsSource()

FBBox SetAsSource ( FBBox  pSource)

Create a sender box.

Use an existing FBBox object to create a sender in the relation.

Parameters
pSourceSource box to insert in the constraint.
Returns
A place holder box for the object.

◆ SetBoxPosition()

bool SetBoxPosition ( FBBox  pBox,
int  pX,
int  pY 
)

Set a box position in the GUI.

Set the position of a box within the constraint layout view.

Parameters
pBoxBox which needs to be moved.
pXNew X position.
pYNew Y position.
Returns
A boolean value indicating success (True) or failure (False).

Member Data Documentation

◆ Boxes

FBListBox Boxes

List: Boxes used in this constraint.