Frame

This class represents the abstraction of a graphical user interface window. The methods of this class allow for simple text and graphics to be displayed in the window. Under program control, the window may be moved on the user's display and its shape may be changed. Each Frame is given a name that is appears on the title bar of the visible window and is used to identify the Frame when mouse events occur in that window. The location of a Frame on the user's display is measured in a coordinate system where the upper left-hand corner of the display is the coordinates (0,0), the x-axis is the top of the display with higher x values to the right, and the y-axis is the left edge of the display with higher values nearer the bottom of the display. The shape of a Frame is given by it width and height, both measures in pixels.

[ Index | Source | Summary | Member Functions ]

Quick Index


Class Summary

class Frame
{

public:
Frame(char *name, Location location, Shape shape);
Frame(char* name, Location loc);
Frame(char* name, Shape sh);
Frame(char* name);
Frame();
~Frame();
void MoveTo(Location location);
void Resize(Shape shape);
void Resize( float factor);
void DrawText(char* msg, Location location);
Shape TextSize (char* msg);
void DrawLine(Location p1, Location p2);
void DrawCircle(Location center, int radius);
void Clear();
void Clear(Location location, Shape shape);
int IsNamed(char* name);
}; // Frame

Back to the top of Frame


Frame(char *name, Location location, Shape shape);

Construct a Frame object specifying the Frame's name, its location - the x and y coordinates, and its shape - its width and height.

   Frame(char *name, Location location, Shape shape);

Back to the top of Frame


Frame(char* name, Location loc);

Construct a Frame object specifying the Frame's name, and its Location. The Frame is constructed with a default Shape.

   Frame(char* name, Location loc);

Back to the top of Frame


Frame(char* name, Shape sh);

Construct a Frame object specifying the Frame's name, and its Shape. The Frame is constructed at a default Location.

   Frame(char* name, Shape sh);

Back to the top of Frame


Frame(char* name);

Construct a Frame object specifying the Frame's name. Both the Location and the Shape of the Frame are determined by defaults.

   Frame(char* name);

Back to the top of Frame


Frame();

Construct a Frame object specifying. The Frame's name, its Location, and its Shape are given default values.

   Frame();

Back to the top of Frame


~Frame();

Destructor: frees resources when Frame object is deleted

  ~Frame();

Back to the top of Frame


void MoveTo(Location location);

Move the Frame's visible window to a specified Location.

   void     MoveTo(Location location);          

Back to the top of Frame


void Resize(Shape shape);

Change the dimensions of the Frame's visible window to a specified Shape.

   void     Resize(Shape shape);                   

Back to the top of Frame


void Resize( float factor);

Change the dimensions of the Frame's visible window by multiplying each dimension by a given amount.

   void     Resize( float factor);              

Back to the top of Frame


void DrawText(char* msg, Location location);

Draw a text string in the Frames' visible window starting at the specified location.

   void     DrawText(char* msg, Location location);  

Back to the top of Frame


Shape TextSize (char* msg);

Return the Shape of the rectangular area occupied in the window by the given text string. This method is useful in erasing a given text string (see the Clear method)

   Shape    TextSize (char* msg);               

Back to the top of Frame


void DrawLine(Location p1, Location p2);

Draw a line segment between two points whose Locations are specified.

   void     DrawLine(Location p1,               // draw line from point p1
                     Location p2);              //           to   point p2

Back to the top of Frame


void DrawCircle(Location center, int radius);

Draw a circle of the specified radius about a specified centerpoint.

   void     DrawCircle(Location center, int radius);

Back to the top of Frame


void Clear();

Erase the contents of the Frame's visible window.

   void     Clear();                            

Back to the top of Frame


void Clear(Location location, Shape shape);

Erase a specified rectangular region of the Frame's visible window. Only the specified rectangular region is affected.

   void     Clear(Location location, Shape shape);      

Back to the top of Frame


int IsNamed(char* name);

Reply if the given string is equal to the name of the Frame.

   int      IsNamed(char* name);                   

Back to the top of Frame


Member Functions

public:
void MoveTo(Location location);
void Resize(Shape shape);
void Resize( float factor);
void DrawText(char* msg, Location location);
Shape TextSize (char* msg);
void DrawLine(Location p1, Location p2);
void DrawCircle(Location center, int radius);
void Clear();
void Clear(Location location, Shape shape);
int IsNamed(char* name);

Back to the top of Frame


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

Report problems to jkotula@unimax.com