Index


[ 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).
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.
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 view/edit the file in a window, 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. 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.
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.
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.
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.
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.
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);

Back to the top of Index


enum MouseState ;

#include "Program.h"

The simple programming environment is defined by four functions. Each of the four 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 Frame. The identity of the frame, the coordinates of the mouse position, and the state of the mouse buttons are passed as parameters.