TLayoutConstraint is a structure that defines a relationship (a layout constraint) between an edge or size of one window and an edge or size of one of the window's siblings or its parent. If a parent-child relationship is established between windows, the dimensions of the child windows are dependent on the parent window. A window can have one of its sizes depend on the size of the opposite dimension.
For example, the width can be twice the height. TLayoutMetrics lists the relationships you can have among size and edge constraints
The following window is displayed by the sample program LAYOUT.CPP, which demonstrates layout constraints:
Layout constraints are specified as a relationship between an edge/size of one window and an edge/size of one of the window's siblings or parent
It is acceptable for a window to have one of its sizes depend on the size of the opposite dimension (e.g. width is twice height)
Distances can be specified in either pixels or layout units
A layout unit is defined by dividing the font "em" quad into 8 vertical and 8 horizontal segments. we get the font by self-sending WM_GETFONT (we use the system font if WM_GETFONT returns 0)
"lmAbove", "lmBelow", "lmLeftOf", and "lmRightOf" are only used with edge constraints. They place the window 1 pixel to the indicated side (i.e. adjacent to the other window) and then adjust it by "Margin" (e.g. above window "A" by 6)
"lmSameAs" can be used with either edges or sizes, and it doesn't offset by 1 pixel like the above four relationships did. it also uses "Value" (e.g. same width as window "A" plus 10)
used for "lmAbove", "lmBelow", "lmLeftOf", "lmRightOf"
MyEdge contains the name of the edge or size constraint (lmTop, lmBottom, lmLeft, lmRight, lmCenter, lmWidth, or lmHeight) for your window.
OtherEdge contains the name of the edge or size constraint (lmTop, lmBottom, lmLeft, lmRight, lmCenter, lmWidth, or lmHeight) for the other window.
used for "lmPercentOf"
Relationship specifies the type of relationship that exists between the two windows (that is, lmRightOf, lmLeftOf, lmAbove, lmBelow, lmSameAs, or lmPercentOf). A value of lmAbsolute actually indicates that no relationship exists.
RelWin is a pointer to the sibling windows or lmParent if the child is a proportion of the parent's dimensions. RelWin points to the window itself (this) if a child window's dimension is a proportion of one of its other dimensions (for example, its height is a proportion of its width).
Units enumerates the units of measurement (either pixels or layout units) used to measure the height and width of the windows. Unlike pixels, layout units are based on system font size and will be consistent in their perceived size even if the screen resolution changes.
used for "lmSameAs" and "lmAbsolute"