home *** CD-ROM | disk | FTP | other *** search
- /*
- draw a box in textmode
- first, define some box-drawing characters
- */
- #define UR 187
- #define LR 188
- #define LL 200
- #define UL 201
- #define HORIZ 205
- #define VERT 186
- #define ESC 27
-
- /*
- define a method for drawing a box on a window
- */
- method Window::drawBox(self,r,c,h,w)
- {
- horiz = chr(HORIZ);
- vert = chr(VERT);
-
- say(r,c,chr(UL));
- for(i=c+1;i<(w+r);i=i+1) say(r,i,horiz);
- say(r,i,chr(UR));
- for(j=r+1;j<(r+h);j=j+1) say(j,i,vert);
- say(j,i,chr(LR));
- for(i=i-1;i>c;i=i-1) say(j,i,horiz);
- say(j,i,chr(LL));
- for(j=j-1;j>r;j=j-1) say(j,i,vert);
- }
-
- /*
- draw a test box
- */
- drawBox(currentWindow(),5,5,10,40);
-