home *** CD-ROM | disk | FTP | other *** search
- program WinTutor(input,output);
- {$Iwindo.inc}
-
- type str80 = string[80];
- var i: integer;
- a: string[127];
- j,k: byte;
- const
- stra : array [1..13] of str80 = (
- '',
- 'The windowing procedures in the file',
- 'WINDO.INC are a set of public domain',
- 'routines that allow Turbo PASCAL to create',
- 'and use windows. The windows may be of any',
- 'size (from 2 X 2 to 80 X 25) and color, and',
- 'may have one of several different border',
- 'styles, including no border. Once inside a',
- 'window, the normal Turbo PASCAL procedures',
- '"textcolor" and "textbackground" may be used',
- 'to change character attributes. The window',
- 'routines automatically determine whether you',
- 'are using a color or monochrome display.');
-
- strb : array [1..14] of str80 = (
- '',
- 'The window procedures package consists of four procedures;',
- '"Initwindo", "Makewindo", "Removewindo" and "Titlewindo".',
- 'The procedures are described in the following windows:',
- 'INITWINDO',
- '',
- 'FORMAT: INITWINDO (textcolor,textbackground : integer);',
- '',
- 'Initwindo initializes several variables required by the',
- 'windowing package, as well as selecting the foreground and',
- 'background colors of the initial screen display. Initwindo',
- 'must be called before using either of the other procedures.',
- 'After using Initwindo, normal action is to clear the screen',
- 'with clrscr.');
-
- strc : array [1..16] of str80 = (
- 'MAKEWINDO',
- '',
- 'FORMAT: MAKEWINDO (X1,Y1,X2,Y2,txtcolor,txtbkgnd,border : integer);',
- '',
- 'Makewindo puts a new blank window on the display. The window starts',
- 'at the upper left corner (X1,Y1) and ends at the lower right corner',
- '(X2,Y2). If a border exists, the actual dimensions of the window',
- 'will be 2 less than indicated in the Makewindo statement. The border',
- 'can be one of the following:',
- '',
- ' singleb - single border doubleb - double border',
- ' solidb - solid border noneb - no border',
- ' mixedb - single sides, double top border',
- ' dimondb - diamond border circleb - circles border',
- ' lhatchb - light hatch border mhatchb - medium hatch border',
- ' dhatchb - dense hatch border');
-
- strd : array [1..6] of str80 = (
- 'REMOVEWINDO',
- 'FORMAT: REMOVEWINDO;',
- '',
- 'Removewindo removes the last window',
- 'that was placed on the screen by the',
- 'Makewindo procedure.');
-
- stre : array [1..6] of str80 = (
- 'TITLEWINDO',
- 'FORMAT: TITLEWINDO (title: string[80]);',
- '',
- 'Titlewindo places a title in the upper',
- 'border of the current window. This is',
- 'strictly an option.');
-
- strf : array [1..6] of str80 = (
- '',
- ' The maximum number of windows that',
- ' may be on the screen at any one time',
- ' is specified by the variable',
- ' "maxwin". Maxwin is currently 30',
- ' and is limited to a maximum of 255.');
-
- stri : array [1..12] of str80 = (
- '',
- ' There are three utility procedures that may be',
- ' of use:',
- '',
- ' Bleep(number_of_bleeps : byte);',
- ' Set_cursor(Cursor_Size : byte);',
- ' DispLine(colb,rowb,attrib : byte, str : str80);',
- '',
- ' colb and rowb is relative to the entire screen.',
- ' attrib := backgroundcolor*16 + textcolor',
- ' str is a string of length 80.',
- ' backgroundcolor should be less than 8.');
-
- strg : array [1..18] of str80 = (
- ' The procedures are used as follows:',
- '',
- ' Program xxx(Input,Output);',
- ' {$IWindo.Inc}',
- ' ...your variables and procedures...',
- ' Begin',
- ' .',
- ' Initwindo(textcolor,textbackground);',
- ' ClrScr;',
- ' .',
- ' Makewindo(X1,Y1,X2,Y2,txtcol,txtbkgnd,brdr);',
- ' Titlewindo(''This is the window title'');',
- ' .',
- ' Removewindo;',
- ' .',
- ' End.',
- '',
- ' Use one removewindo for each makewindo.');
-
- strh : array [1..7] of str80 = (
- 'If you have any questions or comments,',
- 'please write to or call:',
- '',
- ' Michael Burton',
- ' 15540 Boot Hill Rd.',
- ' Hayden Lake, ID 83835',
- ' (208)772-9347 (after 1800 PST)');
-
- begin
- set_cursor(0);
- initwindo(blue,cyan);
- clrscr;
- For i := 1 to 30 do
- begin
- j := random(69);
- k := random(20);
- makewindo(j+1,k+1,j+11,k+5,yellow,red,lhatchb);
- gotoxy(2,2);
- Write('WINDOWS');
- end;
- delay(4000);
- for i := 1 to 30 do removewindo;
- gotoxy(25,1);
- writeln('Turbo PASCAL Windows Tutorial');
- gotoxy(10,2);
- textcolor(black);
- writeln('For each of the following displays, press RETURN to continue.');
- gotoxy(14,12);
- writeln('This is the original screen. It is not a window.');
- readln;
-
- makewindo(3,3,49,18,black,green,mixedb);
- titlewindo(' Turbo PASCAL Windows ');
- For j :=1 to 13 do DispLine(3,j+2,green*16+black,stra[j]);
- readln;
- makewindo(1,5,61,23,yellow,red,singleb);
- titlewindo(' Turbo PASCAL Windows (Continued) ');
- For j :=1 to 4 do DispLine(1,j+4,red*16+yellow,strb[j]);
- DispLine(4,10,blue*16+white,strb[5]);
- For j :=6 to 8 do DispLine(1,j+5,red*16+cyan,strb[j]);
- For j :=9 to 14 do DispLine(1,j+5,red*16+white,strb[j]);
- readln;
-
- makewindo(7,4,77,24,lightmagenta,blue,solidb);
- titlewindo(' Turbo PASCAL Windows (Continued) ');
- DispLine(11,5,red*16+yellow,strc[1]);
- For j :=2 to 4 do DispLine(7,j+5,blue*16+lightred,strc[j]);
- For j :=5 to 16 do DispLine(7,j+5,blue*16+yellow,strc[j]);
- readln;
-
- makewindo(13,10,51,21,black,brown,doubleb);
- titlewindo(' Turbo PASCAL Windows (Continued) ');
- DispLine(17,11,magenta*16+white,strd[1]);
- DispLine(13,13,brown*16+yellow,strd[2]);
- For j :=3 to 6 do DispLine(13,j+11,brown*16+white,strd[j]);
- readln;
-
- makewindo(15,11,57,22,red,lightgray,dimondb);
- titlewindo(' Turbo PASCAL Windows (Continued) ');
- DispLine(19,13,blue*16+lightgreen,stre[1]);
- DispLine(15,15,lightgray*16+black,stre[2]);
- For j :=3 to 6 do DispLine(15,j+13,lightgray*16+green,stre[j]);
- readln;
-
- makewindo(12,16,49,22,black,brown,noneb);
- For j :=1 to 6 do DispLine(11,j+14,brown*16+black,strf[j]);
- readln;
-
- makewindo(20,8,70,22,yellow,red,circleb);
- titlewindo(' Utility Procedures ');
- For j :=1 to 4 do DispLine(20,j+7,red*16+yellow,stri[j]);
- For j :=5 to 7 do DispLine(20,j+7,red*16+white,stri[j]);
- For j :=8 to 12 do DispLine(20,j+7,red*16+yellow,stri[j]);
- readln;
-
- makewindo(29,3,79,25,yellow,magenta,mhatchb);
- For j :=1 to 18 do DispLine(29,j+3,magenta*16+yellow,strg[j]);
- readln;
-
- makewindo(20,8,60,17,black,brown,dhatchb);
- For j :=1 to 7 do DispLine(21,j+8,brown*16+white,strh[j]);
- readln;
-
- removewindo;
- removewindo;
- removewindo;
- removewindo;
- removewindo;
- removewindo;
- removewindo;
- removewindo;
- removewindo;
- gotoxy(1,2);
- clreol;
- gotoxy(1,12);
- clreol;
- gotoxy(21,12);
- writeln('This concludes the windows tutorial...');
- delay(2500);
- set_cursor(2);
- textcolor(white);
- textbackground(black);
- clrscr;
- end.