## wxOGLConstraint

wxCompositeShape overview

An wxOGLConstraint object helps specify how child shapes are laid out with respect to siblings and parents.

Derived from

wxObject

See also

wxCompositeShape

Members

wxOGLConstraint::wxOGLConstraint
wxOGLConstraint::~wxOGLConstraint
wxOGLConstraint::Equals
wxOGLConstraint::Evaluate
wxOGLConstraint::SetSpacing

### wxOGLConstraint::wxOGLConstraint

wxOGLConstraint()

Default constructor.

wxOGLConstraint(int type, wxShape *constraining, wxList& constrained)

Constructor.

Parameters

constraining

The shape which is used as the reference for positioning the constrained objects.

constrained

Contains a list of wxShapes which are to be constrained (with respect to constraining) using type.

type

Can be one of:

- gyCONSTRAINT_CENTRED_VERTICALLY: the Y co-ordinates of the centres of the bounding boxes of the constrained objects and the constraining object will be the same
- gyCONSTRAINT_CENTRED_HORIZONTALLY: the X co-ordinates of the centres of the bounding boxes of the constrained objects and the constraining object will be the same
- gyCONSTRAINT_CENTRED_BOTH: the co-ordinates of the centres of the bounding boxes of the constrained objects and the constraining object will be the same
- gyCONSTRAINT_LEFT_OF: the X co-ordinates of the right hand vertical edges of the bounding boxes of the constrained objects will be less than the X co-ordinate of the left hand vertical edge of the bounding box of the constraining object
- gyCONSTRAINT_RIGHT_OF: the X co-ordinates of the left hand vertical edges of the bounding boxes of the constrained objects will be greater than the X co-ordinate of the right hand vertical edge of the bounding box of the constraining object
- gyCONSTRAINT_ABOVE: the Y co-ordinates of the bottom horizontal edges of the bounding boxes of the constrained objects will be less than the Y co-ordinate of the top horizontal edge of the bounding box of the constraining object
- gyCONSTRAINT_BELOW: the Y co-ordinates of the top horizontal edges of the bounding boxes of the constrained objects will be greater than the X co-ordinate of the bottom horizontal edge of the bounding box of the constraining object
- gyCONSTRAINT_ALIGNED_TOP: the Y co-ordinates of the top horizontal edges of the bounding boxes of the constrained objects will be the same as the Y co-ordinate of the top horizontal edge of the bounding box of the constraining object
- gyCONSTRAINT_ALIGNED_BOTTOM: the Y co-ordinates of the bottom horizontal edges of the bounding boxes of the constrained objects will be the same as the Y co-ordinate of the bottom horizontal edge of the bounding box of the constraining object
- gyCONSTRAINT_ALIGNED_LEFT: the X co-ordinates of the left hand vertical edges of the bounding boxes of the constrained objects will be the same as the X co-ordinate of the left hand vertical edge of the bounding box of the constraining object
- gyCONSTRAINT_ALIGNED_RIGHT: the X co-ordinates of the right hand vertical edges of the bounding boxes of the constrained objects will be the same as the X co-ordinate of the right hand vertical edge of the bounding box of the constraining object
- gyCONSTRAINT_MIDALIGNED_TOP: the Y co-ordinates of the centres of the bounding boxes of the constrained objects will be the same as the Y co-ordinate of the top horizontal edge of the bounding box of the constraining object
- gyCONSTRAINT_MIDALIGNED_BOTTOM: the Y co-ordinates of the centres of the bounding boxes of the constrained objects will be the same as the Y co-ordinate of the bottom horizontal edge of the bounding box of the constraining object
- gyCONSTRAINT_MIDALIGNED_LEFT: the X co-ordinates of the centres of the bounding boxes of the constrained objects will be the same as the X co-ordinate of the left hand vertical edge of the bounding box of the constraining object
- gyCONSTRAINT_MIDALIGNED_RIGHT: the X co-ordinates of the centres of the bounding boxes of the constrained objects will be the same as the X co-ordinate of the right hand vertical edge of the bounding box of the constraining object

### wxOGLConstraint::~wxOGLConstraint

~wxOGLConstraint()

Destructor.

### wxOGLConstraint::Equals

bool Equals(double x, double y)

Returns TRUE if x and y are approximately equal (for the purposes of evaluating the constraint).

### wxOGLConstraint::Evaluate

bool Evaluate()

Evaluates this constraint, returning TRUE if anything changed.

### wxOGLConstraint::SetSpacing

void SetSpacing(double x, double y)

Sets the horizontal and vertical spacing for the constraint.