A SERVICE OF

logo

__________________________________________________________________
rel
Meaning of
value
__________________________________________________________________
When
edge
is
lmWidth
or
lmHeight
,
edge
represents the size of the
constraint.
The owning object determines whether
lmCenter
represents an X or Y
coordinate. See page 156.
__________________________________________________________________
The meaning of value is also dependent on the value of Units. Units is a
TMeasurementUnits member of TLayoutConstraint. TMeasurementUnits is
an enum that describes the type of unit represented by value. Units can be
either lmPixels or lmLayoutUnits. lmPixels indicates that value is meant to
represent an absolute number of physical pixels. lmLayoutUnits indicates
that value is meant to represent a number of logical units. These layout
units are based on the size of the current font of the layout window.
TEdgeConstraint also contains a number of functions that you can use to set
up predefined relationships. These correspond closely to the relationships
you can specify in the Set function. In fact, these functions call Set to define
the constraining relationship. Y u can use these functions to set up ao
majority of the constraint relationships you define.
The following four functions work in a similar way:
void LeftOf(TWindow* sibling, int margin = 0);
void RightOf(TWindow* sibling, int margin = 0);
void Above(TWindow* sibling, int margin = 0);
void Below(TWindow* sibling, int margin = 0);
Each of these functions place 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.
Y u can set an edge of your child window to an absolute value with theo
Absolute function:
void Absolute(TEdge edge, int value);
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:
void SameAs(TWindow* otherWin, TEdge edge);
void PercentOf(TWindow* otherWin, TEdge edge, int percent);
158
OWL P ogrammer’ Guider s