| CLAYOUTiAddConstraint Method |
Add a constraint between any two rectangles or to one with absolute positioning
Available since Oasis montaj version: 6.3.0
License: Available to anyone with an Oasis Montaj license.
Namespace: GeoEngine.Core.GXNetAssembly: geoengine.core.gxnet (in geoengine.core.gxnet.dll)
Notes
Constraints can be applied between 2 rectangles in the layout, or to 1 rectangle with
absolute positioning. Use the constraints to control left, right, bottom, top,
width, height, or centering configurations. Examples:
(ordered as rectangle from, constraint from, rectangle to, constraint to, offset modifier, multiplicative modifier)
A, LAYOUT_CONSTR_LEFT, B, LAYOUT_CONSTR_LEFT, 0, 0, 1.0 Set left position of A equal to left pos of B
A, LAYOUT_CONSTR_LEFT, B, LAYOUT_CONSTR_RIGHT, 0, 0, 1.0 Set left pos of A equal to right of B
The offset modifier is used for additive manipulation of constraints
A, LAYOUT_CONSTR_LEFT, B, LAYOUT_CONSTR_LEFT, 10, 0, 1.0 Set left pos of A equal to left of B, plus 10
A, LAYOUT_CONSTR_BOTTOM, B, LAYOUT_CONSTR_TOP, -20, 0, 1.0 Set bottom of A equal to top of B, minus 20
Multiplicative manipulation of constraints
A, LAYOUT_CONSTR_WIDTH, B, LAYOUT_CONSTR_WIDTH, 0, 0.5 Set the width of A equal to 0.5 times the width of B
A, LAYOUT_CONSTR_HEIGHT, B, LAYOUT_CONSTR_WIDTH, 0, 1.2 Set the height of A equal to 1.2 times the width of B
You can use BOTH the multiplicative and offset modifiers in conjunction (multiplicative gets precedence)
A, LAYOUT_CONSTR_WIDTH, B, LAYOUT_CONSTR_WIDTH, 10, 0.5 A(width) = (0.5 * B(width)) + 10
A, LAYOUT_CONSTR_LEFT, B, LAYOUT_CONSTR_WIDTH, -20, 0.1 A(left) = (0.1 * B(width)) + (-20)
If second node is -2, use absolute positioning
A,LAYOUT_CONSTR_LEFT,-2,<ignored>,25,<ignored>,<ignored> Position left of A at position 25
A,LAYOUT_CONSTR_WIDTH,-2,<ignored>,30,<ignored>,<ignored> Set width of A to 30
Use the MOVE constraints to move an entire window without resizing
A, LAYOUT_CONSTR_MOVEL, B, LAYOUT_CONSTR_LEFT, 0, 0, 1.0 Move node A, align left with left side of B
A, LAYOUT_CONSTR_MOVEL, B, LAYOUT_CONSTR_RIGHT, 0, 0, 1.0 Move node A, align left with right side of B
A, LAYOUT_CONSTR_MOVET, B, LAYOUT_CONSTR_WIDTH, 0, 0, 1.0 Move node A, align bottom to position equal to width of B
A, LAYOUT_CONSTR_MOVER, B, LAYOUT_CONSTR_RIGHT, 10, 1.1 Move node A, align right to 1.1*right of B, plus 10
A, LAYOUT_CONSTR_MOVEL, NULL, 10, 0, 1.0 Move node A, align left at position 10
Syntax public int iAddConstraint(
int i1,
int i2,
int i3,
int i4,
double d5,
double d6
)
Public Function iAddConstraint (
i1 As Integer,
i2 As Integer,
i3 As Integer,
i4 As Integer,
d5 As Double,
d6 As Double
) As Integer
public:
int iAddConstraint(
int i1,
int i2,
int i3,
int i4,
double d5,
double d6
)
member iAddConstraint :
i1 : int *
i2 : int *
i3 : int *
i4 : int *
d5 : float *
d6 : float -> int
Parameters
- i1
- Type: SystemInt32
From rectangle (Or -1 for parent) - i2
- Type: SystemInt32
See LAYOUT_CONSTRConstant From constraint flag - i3
- Type: SystemInt32
To rectangle (Or -1 for parent Or -2 for absolute positioning) - i4
- Type: SystemInt32
See LAYOUT_CONSTRConstant To constraint flag - d5
- Type: SystemDouble
Offset modifier - d6
- Type: SystemDouble
Multiplicative modifier
Return Value
Type:
Int32
0 - OK
1 - Error
See Also