[
Classes |
Constants |
Functions
]
Quick Index
Classes
- BlinkingMessage
-
A BlinkingMessage encapsulates the state and functionality to support a
"blinking" text string. The state of a BlinkingMessage object records
whether the text string is currently visible and, when asked to "blink"
either draws itself (if it is currently not visible) or erases itself
(if it is currently visible).
- Button
-
This class captures the abstraction of a pushable control in the
user interface. Each button has a name that defines the text
appearing on the face of the button. The name suggests the action
associated with the button being pushed. When the button is pushed,
the OnPush function of the simple programming environment is called
with the name of the button as a parameter. By testing this name,
the identity of the pushed button can be determined.
A button appears at a
specified Location within a Panel and occupies a region defined by
a Shape. A button is added to a Panel using a method defined in
the Panel class.
- Canvas
-
The Canvas class captures the abstraction of a named, interactive surface
on which text and graphics can be drawn. Methods are provided for
drawing lines, circles, and text strings. Mouse events that happen
within the boundaries of the displayed Canvas are reported by
calling the OnMouseEvent function passing the name of the Canvas
as an argument. Erasure of the entire canvas
or of a selected rectangular region is provided.
- Clock
-
This class captures the concept of a simple timer. The granularity of
the timer is in milliseconds. The granularity is specified when a
Clock object is constructed and can be changed by the SetInterval
method. The OnTimerEvent
function is called at the end of each time interval with the name
of the Clock object being passed as a parameter.
- Color
-
This class represents a color. A color is defined by the combination
of given amounts of red, green, and blue. This method of defining
colors is referred to as an RGB color model. Different colors are obtained
by altering the amounts of the three base colors. The amount of each
base color is specified as an integer value in the range from
0 to 255 (an 8-bit color model). A Color object can be used to specify
the colors to be used for drawing and filling in a Canvas.
- Counter
-
This class captures the concept of a simple integer counter that
counts upwards from a given, by default zero, initial value. A
Counter object can be connected to a Message in which the counter
will display its current value.
- File
-
This class captures the abstraction of a disk-based file. A File
object can be directly constructed with the name of a file in the
file system or it may be returned by a file dialogue such as
FileQuery, FileChooser, or FileNavigator. The File class provides
methods to query the name of the file, determine if the file
actually exists, to search the file for a given text string, to
view/edit the file in a window, to copy one file to another, and
to delete the file from the file system.
- FileChooser
-
The objects of this class can conduct a modal dialogue with the
user for the purpose of obtaining a File. The user is
presented with a list of names of files in a given directory that match
a specified filter pattern. The user is asked to pick one of the
filenames in the list.
- FileNavigator
-
This class initiates a modal dialogue with the user to obtain a
File. The user is presented with a dialogue box which
shows all the names of files in a specified directory that match a given
filter pattern. The user is able to navigate to higher and lower
directories in the file system in search of the desired File.
- FileQuery
-
This class initiates a modal dialogue with the user to obtain a
File. The user is presented with a dialogue box into which
the user types the name of the File. The FileQuery provides a
default filename and a filter indicating the type of filename
desired. However, the filter is not enforced and is given only as
a hint to the user.
- Frame
-
This class represents the abstraction of a graphical user interface
window. A Frame can logically contain any number of non-overlapping
Panels and Canvases within its boundaries. The Panel and Canvas
constructors create an association between themselves and a Frame.
The methods of the Frame class allow the window
to be moved on the user's display and its shape changed.
Each Frame is given a name that is appears on the title bar of the
visible 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.
- FrameManager
-
A FrameManager maintains a collection of Frame objects and retrieves
a Frame from the collection by the Frame's name. Methods allow Frames
to be added and removed.
- Location
-
This class defines the concepts of a Location in a coordinate system
where the (0,0) position is in the upper left-hand corner. The x-axis
extends in a positive direction to the right and the y-axis extends in
a positive direction towards the bottom of the screen.
- LocationNode
-
This class is a utility object that allows Location
objects to be linked together to form a list without modifying
the code of the Location class (e.g., to insert a pointer to
the next element in the list). Each LocationNode contains a
pointer to a Location object that it represents in the list,
and a pointer to the next LocationNode in the list.
- 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.
- Panel
-
This class captures the abstraction of a "control panel" - a region
within a Frame that contains interactive controls. Two types of
interactive controls can be placed in a Panel: Button objects and
TextBoxes objects.
- PolyShape
-
This class captures the abstraction of a closed polygon shape. The
- PrimitiveMessage
-
This class defines a minimal abstraction of a text-bearing
message. The class provides method to set and retrieve the
text that is part of the message but is unable to provide
any higher-level handling of the text. The PrimitiveMessage
object always maintains its own private copy of the text
string so that its value is unaffected by changes to text
strings outside of the PrimitiveMessage object.
- Query
-
This class represents the abstraction of a "text search query". A
Query maintains two text strings, one representing a string of
text to be searched for (the "search" string) and one representing
the outcome of the search (the "result" string). The Query does not
engage in the search but simply provides a container for the
input to a search and the results. Get and set methods are provided
for each of the two strings (the search string and the result string).
In addition, the user may be asked to supply the search string through
a modal dialogue.
- 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.
- Rectangle2
-
This class represents a rectangular shape. The dimensions and initial
position of the Rectangle2 within a Canvas are specified when the
Rectangle2 is constructed. The Rectangle2 may be moved relative to its
current positions, drawn, and erased.
This class uses a static (class) variable defined as:
static Color rectangleColor;
which is the color used to draw all rectangles. The SetColor
method changes this static (class) variable and, thereby, affects
the drawing color of all rectangles.
- Rectangle3
-
This class represents a rectangular shape that is constructed only
the the RectangleFactory that guarantees that all objects it produces
have the same Shape. To insure the uniformity of their Shapes, the
Rectangle3 constructor is private and the RectangleFactory is
declared as a friend class so that it alone has access to
the Rectangle3 constructor. The dimensions and initial
position of the Rectangle3 within a Canvas are specified when the
Rectangle3 is constructed by the RectangleFactory.
The Rectangle3 may be moved relative to its
current positions, drawn, and erased, but not resized.
This class uses a static (class) variable defined as:
static Color rectangleColor;
which is the color used to draw all rectangles. The SetColor
method changes this static (class) variable and, thereby, affects
the drawing color of all rectangles.
- RectangleFactory
-
This class is a producer of Rectangle3 object all of which are
constrained to have the same Shape. This class illustrates the
"factory" concept - an object that manufactures other objects as
its output.
- Shape
-
This class captures the concepts of the shape of a rectangular
graphical user interface item (e.g, a window object). Shape
objects are used to describe the dimensions of the visible
window of a Frame, and an area within a Frame's visible window.
- StopWatch
-
This class captures the abstraction of a simple timing device that
can be started and stopped. A simple elaspsed time value is maintained
and drawn by the StopWatch. Two Buttons, named "Start" and "Stop"
allow the timing to be halted or resumed. Stopping the StopWatch
does NOT reset the internal elapsed time counter.
- TextFrame
-
This class captures the abstraction of a window into which
information can be written in a stream-like fashion.
The window is constructed in a way
similar to a Frame (with a name, Location, and Shape) and may also
be moved and resized. Unlike a Frame, the TextFrame provides a
set of stream I/O operators that allow basic types to be converted
into text and displayed in the window. Formatting is primitive:
blanks between fields are inserted by streaming to the window a
text string of blanks, lines are ended by streamng to the window
the newline ('\n') or end-of-line (EOL) character.
Back to the top of Index
Constants
- enum MouseState ;
Back to the top of Index
Global Functions
- void OnStart(void);
- void OnMouseEvent(char *frame, int x, int y, int buttonState);
- void OnTimerEvent(void);
- void OnPaint(void);
- void OnPush(char* buttonName);
Back to the top of Index
enum MouseState ;
#include "Program.h"
The simple programming environment is defined by five functions.
Each of the five functions in the simple programming environment
MUST be defined, even if the body of the function contains no code.
The Program.h include file defines four constants that describe
the state of the mouse buttons when a mouse event occurs. These
constants are used in the OnMouseEvent function's buttonState
parameter.
enum MouseState { leftButtonDown = 1,
rightButtonDown = 2,
middleButtonDown = 4,
isDragging = 8 };
Back to the top of Index
void OnStart(void);
#include "Program.h"
This function is called exactly once when the "Start" button
in the start window is pressed. This function is used to initialize
the system.
void OnStart(void);
Back to the top of Index
void OnMouseEvent(char *frame, int x, int y, int buttonState);
#include "Program.h"
This function is called whenever a mouse event occurs within a
user-defined Canvas. The identity of the Canvas, the coordinates of
the mouse position, and the state of the mouse buttons are passed
as parameters.
- canvas: this string defines the name of the frame in which
the mouse event occurred. The name of the frame was given in
the Frame constructor.
- x: the x coordinate (with respect to the upper left-hand
corner of where the mouse was located when the mouse event
occurred.
- y: the y coordinate (with respect to the upper left-hand
corner of where the mouse was located when the mouse event
occurred.
- buttonState: the condition of the mouse buttons at the
time of the mouse event. The possible values for this integer
variable are given by the four defined constants
leftButtonDown, rightButtonDown,
middleButtonDown, and isDragging.
void OnMouseEvent(char *frame, int x, int y, int buttonState);
Back to the top of Index
void OnTimerEvent(void);
#include "Program.h"
This function is called whenever the timer has been started by the
user (using the Timer pulldown menu in the start window of the
simple programming environment) and the timer has reached the end
of the current timer interval. The timer interval can be changed
by the slider control in the start window. The function is called
repeatedly, at the end of each timer interval, as long as the timer
is turned on. The timer may be turned off by using the Timer
pulldown menu in the start window.
void OnTimerEvent(void);
Back to the top of Index
void OnPaint(void);
#include "Program.h"
This function is called whenever the system suspects that the
contents of a window may need to be refreshed (redrawn) due to
actions in the user interface (e.g, by moving a window
that was obscuring part of a lower window, requiring the lower
(previously obscured) window to be redrawn).
void OnPaint(void);
Back to the top of Index
void OnPush(char* buttonName);
#include "Program.h"
This function is called whenever a button in the user interface is
pushed by the user. The name of the Button object (identical to the
label on the face of the displayed button) is passed as an argument.
the OnPush function is expected to take or cause the actions
that properly respond to the user's pressing of the button.
void OnPush(char* buttonName);
Back to the top of Index
Generated from source by the Cocoon utilities on Thu Apr 02 12:40:31 1998
.
Report problems to jkotula@unimax.com