OWLNext 7.0
Borland's Object Windows Library for the modern age
|
The most basic way to define a constraining relationship (that is, set up a relationship between an edge or size of one window and an edge or size of another window) is to use the Set function.
The Set function is defined in the TEdgeConstraint class and subsequently inherited by TEdgeOrWidthConstraint and TEdgeOrHeightConstraint. Here is the Set function declaration:
In this declaration,
rel | Relationship |
lmAsIs | This dimension is constrained to its current value. |
lmPercentOf | This dimension is constrained to a percentage of the constraining edge's size. This is usually used with a constraining width or height. |
lmAbove | This dimension is constrained to a certain distance above its constraining edge. |
lmLeftOf | This dimension is constrained to a certain distance to the left of its constraining edge. |
lmBelow | This dimension is constrained to a certain distance below its constraining edge. |
lmRightOf | This dimension is constrained to a certain distance to the right of its constraining edge. |
lmSameAs | This dimension is constrained to the same value as its constraining edge. |
lmAbsolute | This dimension is constrained to an absolute coordinate or size. |
rel | Meaning of value |
lmAsIs | No meaning. Should be set to 0. |
lmPercentOf | What percent of the constraining measure the constrained measure should be. |
lmAbove | How many units above the constraining edge the constrained edge should be. |
lmLeftOf | How many units to the left of the constraining edge the constrained edge should be. |
lmBelow | How many units below the constraining edge the constrained edge should be. |
lmRightOf | How many units to the left of the constraining edge the constrained edge should be. |
lmSameAs | No meaning. Should be set to 0. |
lmAbsolute | The absolute measure for the constrained edge, as follows:
The owning object determines whether lmCenter represents an X or Y coordinate. |
The following four functions work in a similar way:
Each of these functions places the child window in a certain relationship with the constraining window sibling. The edges are predefined, with the constrained edge being the opposite of the function name and the constraining edge being the same as the function name.
For example, the LeftOf function places the child window to the left of sibling. This means the constrained edge of the child window is lmRight and the constraining edge of sibling is lmLeft.
You can set an edge of your child window to an absolute value with the Absolute function,
edge indicates which edge you want to constrain, and value has the same value as when used in Set with the lmAbsolute relationship.
There are two other shortcut functions you can use,
These two use the same edge for the constrained window and the constraining window. For example, if you specify lmLeft for edge, the left edge of your child window is constrained to the left edge of otherWin.