Index


[ Classes | Constants | Functions ]

Quick Index



Classes

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. The Frame class declares several named constants that are used to identify the nature of mouse events that occur in a window.
TextFrame
This class captures the abstraction of a window which displays a text stream. The class provides a stream output operator ("<<") for each of the C++ built-in types. The methods for placing and sizing of a TextFrame object are the same as for a Frame object.The constant "endl" is defined for a TextFrame so that it has the same meaning as for standard streams such as cout, namely, that it terminates the end of the current line of output.

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.

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


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

Report problems to jkotula@unimax.com