OWLNext    7.0
Borland's Object Windows Library for the modern age
Loading...
Searching...
No Matches
owl::TLayoutConstraint Struct Reference

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. More...

#include <owl/layoutco.h>

Inheritance diagram for owl::TLayoutConstraint:
owl::TEdgeConstraint owl::TEdgeOrSizeConstraint owl::TEdgeOrHeightConstraint owl::TEdgeOrWidthConstraint

Public Attributes

TWindowRelWin
 RelWin is a pointer to the sibling windows or lmParent if the child is a proportion of the parent's dimensions.
 
uint MyEdge: 4
 MyEdge contains the name of the edge or size constraint (lmTop, lmBottom, lmLeft, lmRight, lmCenter, lmWidth, or lmHeight) for your window.
 
TRelationship Relationship: 4
 Relationship specifies the type of relationship that exists between the two windows (that is, lmRightOf, lmLeftOf, lmAbove, lmBelow, lmSameAs, or lmPercentOf).
 
TMeasurementUnits Units: 4
 Units enumerates the units of measurement (either pixels or layout units) used to measure the height and width of the windows.
 
uint OtherEdge: 4
 OtherEdge contains the name of the edge or size constraint (lmTop, lmBottom, lmLeft, lmRight, lmCenter, lmWidth, or lmHeight) for the other window.
 
union { 
 
   int   Margin 
 used for "lmAbove", "lmBelow", "lmLeftOf", "lmRightOf" More...
 
   int   Value 
 used for "lmSameAs" and "lmAbsolute" More...
 
   int   Percent 
 used for "lmPercentOf" More...
 
};  
 This union is included for the convenience of naming the layout constraints.
 

Detailed Description

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)

Note
"Margin" is either added to ("lmAbove" and "lmLeftOf") or subtracted from("lmBelow" and "lmRightOf") depending on the relationship

"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)

Note
"Value" is always added. use a negative number if you want the effect to be subtractive

Definition at line 121 of file layoutco.h.

Member Data Documentation

◆ [union]

union { ... } owl::TLayoutConstraint

This union is included for the convenience of naming the layout constraints.

Margin is used for the ImAbove, ImLeftOf, ImLeftOf, or ImRightOf enumerated values in TRelationship. Value is used for the ImSameAs or ImAbsolute enumerated values in TRelationship. Percent is used for the ImPercentOf enumerated value in TRelationship.

◆ Margin

int owl::TLayoutConstraint::Margin

used for "lmAbove", "lmBelow", "lmLeftOf", "lmRightOf"

Definition at line 154 of file layoutco.h.

◆ MyEdge

uint owl::TLayoutConstraint::MyEdge

MyEdge contains the name of the edge or size constraint (lmTop, lmBottom, lmLeft, lmRight, lmCenter, lmWidth, or lmHeight) for your window.

Definition at line 130 of file layoutco.h.

◆ OtherEdge

uint owl::TLayoutConstraint::OtherEdge

OtherEdge contains the name of the edge or size constraint (lmTop, lmBottom, lmLeft, lmRight, lmCenter, lmWidth, or lmHeight) for the other window.

Definition at line 146 of file layoutco.h.

◆ Percent

int owl::TLayoutConstraint::Percent

used for "lmPercentOf"

Definition at line 156 of file layoutco.h.

◆ Relationship

TRelationship owl::TLayoutConstraint::Relationship

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.

Definition at line 136 of file layoutco.h.

◆ RelWin

TWindow* owl::TLayoutConstraint::RelWin

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).

Definition at line 126 of file layoutco.h.

◆ Units

TMeasurementUnits owl::TLayoutConstraint::Units

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.

Definition at line 142 of file layoutco.h.

◆ Value

int owl::TLayoutConstraint::Value

used for "lmSameAs" and "lmAbsolute"

Definition at line 155 of file layoutco.h.


The documentation for this struct was generated from the following file: