Message

This class captures the abstraction of a text string that can be drawn and erased from a given Location in a Frame with which the Message is associated.

[ Index | Source | Summary | Member Functions ]

Quick Index


Class Summary

class Message
{

public:
Message(char *textString, Location whereAt);
Message(Location whereAt);
Message (const Message& other);
void DisplayIn(Canvas& whichCanvas);
void MoveTo(Location newLocation);
void SetText(char *newText);
char *GetText();
void Draw();
void Clear();
void operator= (const Message& other);
~Message();
}; // Message

Back to the top of Message


Message(char *textString, Location whereAt);

Construct a Message object with a given text string and an associated position where it will be displayed in a Canvas's visible region.

   Message(char *textString, Location whereAt);

Back to the top of Message


Message(Location whereAt);

Construct a Message object with a default text string (the empty string) and an associated position where it will be displayed in a Canvas's visible region.

   Message(Location whereAt);

Back to the top of Message


Message (const Message& other);

Construct a new Message object whose initialization is based on an existing Message object. Only the text string is initialized. The existing Message object is passed by reference and the parameter is declared const because the existing object is not changed as a result of constructing the new Message object.

   Message (const Message& other);  // copy constructor

Back to the top of Message


void DisplayIn(Canvas& whichCanvas);

Define in which Canvas object the text string will be drawn.

   void DisplayIn(Canvas& whichCanvas);

Back to the top of Message


void MoveTo(Location newLocation);

Change the location of where the text string is drawn. If the text is currently visible, it will be erased from its current location and redrawn at its new location.

   void MoveTo(Location newLocation);

Back to the top of Message


void SetText(char *newText);

Change the text that is displayed.

   void SetText(char *newText);

Back to the top of Message


char *GetText();

Return the current text string of the Message.

   char *GetText();

Back to the top of Message


void Draw();

Draw the current text string in the Canvas with which the Message is currently associated at the Message's current Location. This method has no effect if the Message is not associated with a Canvas.

   void Draw();

Back to the top of Message


void Clear();

Erase the current text string from the Canvas with which the Message is currently associated.

   void Clear();

Back to the top of Message


void operator= (const Message& other);

Define a class-specific assignment operator. This method defines what occurs when one Message object is assigned to another Message object using the standard assignment operator (=).

   void operator= (const Message& other); //assignment operator

Back to the top of Message


~Message();

Release the resources associated with the Message object.

   ~Message();

Back to the top of Message


Member Functions

public:
void DisplayIn(Canvas& whichCanvas);
void MoveTo(Location newLocation);
void SetText(char *newText);
char *GetText();
void Draw();
void Clear();
void operator= (const Message& other);

Back to the top of Message


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

Report problems to jkotula@unimax.com