Rectangle1

This class represents a rectangular shape. The dimensions and initial position of the Rectangle within a Canvas are specified when the rectangle is constructed. The rectangle may be moved relative to its current positions, drawn, and erased. Note: the name of the class has a suffixed digit to differentiate it from two variations (Rectangle2 and Rectangle3) of this class and because the name "Rectangle" conficts with predefined names on some systems.

[ Index | Source | Summary | Member Functions ]

Quick Index


Class Summary

class Rectangle1

{

public:
Rectangle1 (Location corner, Shape shape);
void MoveUp (int deltaY);
void MoveDown (int deltaY);
void MoveLeft (int deltaX);
void MoveRight (int deltaX);
void Draw(Canvas& canvas);
void Clear(Canvas& canvas);
~Rectangle1();
}; // Rectangle1

Back to the top of Rectangle1


Rectangle1 (Location corner, Shape shape);

Construct a rectangle object that represents a rectangular shape at a given position.

	  Rectangle1 (Location corner, Shape shape);

Back to the top of Rectangle1


void MoveUp (int deltaY);

Move the Location of the Rectangle a given amount toward the top edge of the Canvas relative to its current position.

	  void MoveUp    (int deltaY);

Back to the top of Rectangle1


void MoveDown (int deltaY);

Move the Location of the Rectangle a given amount toward the bottom edge of the Canvas relative to its current position.

	  void MoveDown  (int deltaY);

Back to the top of Rectangle1


void MoveLeft (int deltaX);

Move the Location of the Rectangle a given amount toward the left edge of the Canvas relative to its current position.

	  void MoveLeft  (int deltaX);

Back to the top of Rectangle1


void MoveRight (int deltaX);

Move the Location of the Rectangle a given amount toward the right edge of the Canvas relative to its current position.

	  void MoveRight (int deltaX);

Back to the top of Rectangle1


void Draw(Canvas& canvas);

Draw the Rectangle at its current position in a given Canvas.

	  void Draw(Canvas& canvas);

Back to the top of Rectangle1


void Clear(Canvas& canvas);

Erase the Rectangle from the given Canvas in which it is drawn. Note: no check is made that the Rectangle is actually drawn in this Canvas; it is the programmer's responsibility to insure this condition.

	  void Clear(Canvas& canvas);

Back to the top of Rectangle1


~Rectangle1();

Release the resources held by the Rectangle object.

	  ~Rectangle1();

Back to the top of Rectangle1


Member Functions

public:
void MoveUp (int deltaY);
void MoveDown (int deltaY);
void MoveLeft (int deltaX);
void MoveRight (int deltaX);
void Draw(Canvas& canvas);
void Clear(Canvas& canvas);

Back to the top of Rectangle1


Generated from source by the Cocoon utilities on Thu Apr 02 12:40:36 1998 .

Report problems to jkotula@unimax.com