Hide thumbs Also See for ClassPad 300:
Table of Contents

Advertisement

negative screen coordinates. This simply means that the object has been moved partially
or entirely off the visible screen. Of course PEG clipping methods prevent the object
from trying to access the non-existent area of video memory.

PegRect

A large part of your programming tasks when working with the graphical interface on the
ClassPad will revolve around defining and calculating rectangular areas on the screen. By
providing a very complete set of operators and miscellaneous member functions, the
PegRect class is designed to facilitate these types of operations. PegRect is defined as:
struct PegRect
{
void Set(SIGNED x1, SIGNED y1, SIGNED x2, SIGNED y2)
{
wLeft = x1;
wTop = y1;
wRight = x2;
wBottom = y2;
}
void Set(PegPoint ul, PegPoint br)
{
wLeft = ul.x;
wTop = ul.y;
wRight = br.x;
wBottom = br.y;
}
BOOL Contains(PegPoint Test);
BOOL Contains(SIGNED x, SIGNED y);
BOOL Contains(PegRect &Rect);
BOOL Overlap(PegRect &Rect);
void MoveTo(SIGNED x, SIGNED y);
void Shift(SIGNED xShift, SIGNED yShift);
PegRect operator &=(PegRect &Other);
PegRect operator |= (PegRect &Other);
PegRect operator &(PegRect &Rect);
PegRect operator ^= (PegRect &Rect);
PegRect operator +(PegPoint &Point);
PegRect operator ++(int x);
PegRect operator += (SIGNED);
PegRect operator --(int x);
PegRect operator -= (SIGNED);
BOOL operator != (PegRect &Rect);
BOOL operator == (PegRect &Rect);
SIGNED Width(void) {return (wRight - wLeft + 1);}
SIGNED Height(void) { return (wBottom - wTop + 1);}
SIGNED wLeft;
SIGNED wTop;
SIGNED wRight;
SIGNED wBottom;
};
19

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents