TRect Class Reference

[tvision Index] [tvision Hierarchy] [Headers]


A screen rectangular area More...

#include <objects.h>

Public Members


Detailed Description

A screen rectangular area.

TRect is used to hold two coordinates on the screen, which usually specify the upper left corner and the lower right corner of views. Sometimes the second coordinate speficy the size (extension) of the view. The two coordinates are named `a' and `b'.

See Also: TPoint


TRect( int ax, int ay, int bx, int by ) [public]

Constructor.

Initializes the rectangle coordinates using the four integer parameters.

TRect( TPoint p1, TPoint p2 ) [public]

Constructor.

Initializes the rectangle coordinates using two points.

See Also:
TPoint

TRect() [public]

Constructor.

Does nothing. The two coordinates are not initialized, so they contain garbage.

void move( int aDX, int aDY ) [public]

Moves the rectangle to a new position.

The two parameters are added to the two old coordinates as delta values. Both parameters can be negative or positive.

void grow( int aDX, int aDY ) [public]

Enlarges the rectangle by a specified value.

The left side is left-moved by `aDX' units and the right side is right-moved by `aDX' units. In a similar way the upper side is upper-moved by `aDY' units and the bottom side is bottom-moved by `aDY' units.

void intersect( const TRect& r ) [public]

Calculates the intersection between this rectangle and the parameter rectangle.

The resulting rectangle is the larger rectangle which contains both part of this rectangle and part of the parameter rectangle.

void Union( const TRect& r ) [public]

Calculates the union between this rectangle and the parameter rectangle.

The resulting rectangle is the smaller rectangle which contains both this rectangle and the parameter rectangle.

Boolean contains( const TPoint& p ) const [public]

Checks if a certain point is contained into the rectangle.

See Also:
TPoint

Boolean operator ==( const TRect& r ) const [public]

Checks if two rectangles are equal (have the same coordinates).

Boolean operator !=( const TRect& r ) const [public]

Checks if two rectanges are not equal (have different coordinates).

Boolean isEmpty() [public]

Checks if the rectangle is empty, i.e. if the first coordinate is greater than the second one.


Documentation generated by sergio@athena.milk.it on Wed Feb 10 22:11:47 CET 1999
Kdoc