home *** CD-ROM | disk | FTP | other *** search
- // CRect.cpp: CRectangle implementation file
-
- #include "crect.h"
- #include <stdlib.h>
-
- void Line (int X1, int Y1, int X2, int Y2);
-
- void CRectangle::Draw (void)
- {
- Line (Left, Top, Right, Top);
- Line (Right, Top, Right, Bottom);
- Line (Right, Bottom, Left, Bottom);
- Line (Left, Bottom, Left, Top);
- }
-
- void CRectangle::SetCoord (int L, int T, int R, int B)
- {
- L = __min (__max (0,L), 80);
- T = __min (__max (0,T), 25);
- R = __min (__max (0,R), 80);
- B = __min (__max (0,B), 25);
- R = __max (R,L);
- B = __max (B,T);
- Left = L; Top = T; Right = R; Bottom = B;
- }
-