[ Index | Source | Summary | Member Functions ]
Back to the top of Canvas
Canvas(Frame& frame, char *name, Location location, Shape shape);
Construct a Canvas as a region within an existing Frame. In
addition to the Canvas's name (used for reporting the occurrence
of mouse events within the Canvas's area), the Location within
the Frame and the Shape of the Canvas are specified. It is
important that the Frame be of sufficient size so that the
Canvas' position and dimensions allow the Canvas to be
entirely contained within the Frame.
Canvas(Frame& frame, char *name, Location location, Shape shape);
Back to the top of Canvas
void SetDrawColor(Color color);
Set the Color to be used when drawing text or graphics. This color
remains in effect for all subsequent drawing operations until the
drawing color is changed. Different Canvases may, of course, have
different drawing colors.
void SetDrawColor(Color color);
Back to the top of Canvas
void SetFillColor(Color color);
Set the Color to be used when filling closed graphics shapes. This color
remains in effect for all subsequent filling operations until the
filling color is changed. Different Canvases may, of course, have
different filling colors.
void SetFillColor(Color color);
Back to the top of Canvas
void DrawText(char* msg, Location loc);
Draw a text string in the Frames' visible window starting at the
specified location.
void DrawText(char* msg, Location loc);
Back to the top of Canvas
Shape TextSize (char* msg);
Return the Shape of the rectangular area occupied by the given
text string when the string is displayed in the Canvas. This
method is typically used in conjunction with the Clear method
that requires a Shape as one of its argument.
Shape TextSize (char* msg);
Back to the top of Canvas
void DrawLine(Location p1, Location p2);
Draw a line segment between two points whose Locations are specified.
void DrawLine(Location p1, Location p2);
Back to the top of Canvas
void DrawCircle(Location center, int r);
Draw a circle of the specified radius about a specified centerpoint.
void DrawCircle(Location center, int r);
Back to the top of Canvas
void Clear();
Erase the contents of the Frame's visible window.
void Clear();
Back to the top of Canvas
void Clear(Location loc, Shape sh);
Erase a specified rectangular region of the Frame's visible window.
Only the specified rectangular region is affected.
void Clear(Location loc, Shape sh);
Back to the top of Canvas
char* getName();
Return the name of the Canvas. The name of the Canvas is
defined by the Canvas's constructor. The name is useful in
determining in which Canvas a given mouse event occured.
char* getName();
Back to the top of Canvas
~Canvas();
Destructor: deallocate resources held by the Canvas object.
~Canvas();
Back to the top of Canvas
Back to the top of Canvas
Report problems to jkotula@unimax.com