home *** CD-ROM | disk | FTP | other *** search
- { Qdemo.pas - Demonstration program for Q screen utilities ver 1.3, 11-10-86 }
- {$I qwik13.inc}
-
- var Row,Rows,Col,Cols,Step,Rstep,Cstep,
- RowEdge,RowMax,ColEdge,ColMax,Count,Attrib,i,wait: integer;
- HideCursor,OldCursor,Fgrnd,Bgrnd: integer;
- Strng: String[75];
- Data: array [1..9] of String[80];
-
- begin
- { --- Set up data --- }
- ToEGA:=EGAcheck; { << << Required intializing statement !! }
- Wait:= 500;
- HideCursor:=8192;
- Strng:= ' Q Screen Utilities ';
- Data[1]:= '1';
- Data[2]:= '22';
- Data[3]:= '333';
- Data[4]:= Strng;
- Data[5]:= 'Odd Length';
- Data[6]:= 'Even Length';
- Data[7]:= '18 characters wide';
- Data[8]:= '19 characters width';
- Data[9]:= 'Margin to Margin width';
-
- { --- Initial screen --- }
- CursorChange (HideCursor, OldCursor);
- Qfill ( 1, 1, 31,' ',2000); { Clear Screen }
- QwriteCV (11, 1,80, 30, Strng);
- QwriteC (13, 1,80, -1,'10,000 fills to your screen.');
- QwriteC (14, 1,80, -1,'Hold on to your seat ...');
- Delay (Wait*5);
-
- { --- Explosion of Boxes --- }
- Qfill (11, 1, -1,' ',320); { Clear Lines }
- Qattr ( 1, 1,112,2000); { Change screen attribute }
- for step:=2 to 40 do
- begin
- if Step>24 then Rstep:=12 else Rstep:=Step div 2;
- RowMax:= 13 + Rstep;
- ColMax:= 40 + Step;
- for Count:=1 to 25 do
- begin
- Row:= 13 - Rstep + random(Rstep+Rstep+1);
- Rows:= Rstep;
- RowEdge:= Row + Rows;
- if RowEdge>RowMax then Rows:= RowMax-Row+1;
- Col:= 40 - step + random(step+step+1);
- Cols:= Rstep + Rstep + Rstep shr 2;
- ColEdge:= Col + Cols;
- if ColEdge>ColMax then Cols:= ColMax-Col+1;
- Fgrnd:= random (16);
- Bgrnd:= random (8);
- if Bgrnd=Fgrnd then Fgrnd:=Fgrnd + 1;
- Attrib:= (Bgrnd shl 4) + Fgrnd;
- for i:=0 to Rows-1 do
- Qfill (Row+i,Col,Attrib,#178,Cols);
- end
- end;
- for i:=1 to 6 do
- Qfill ( 9+i,24, 64,' ',34);
- for i:=1 to 4 do
- Qfill (10+i,26,110,' ',30);
- QwriteCV(12, 1,80, 78, Strng);
- QwriteC (13, 1,80, 78,' Version 1.3 ');
- Delay (Wait*6);
- Qwrite ( 8, 3, 31,'Qwrite will write with new attributes that you specify direct to the screen.');
- Delay (Wait*6);
- Qwrite (17, 3, -1,'Qwrite will also use existing attributes when you do not even know or care.');
- Qattr (17,24,199,8); { highlight the word 'existing' }
- Delay (wait*10);
-
- { --- Centering Demo --- }
- Qfill ( 1, 1, 48,' ',2000); { Clear Screen }
- QwriteC ( 2, 1,80, -1,'QwriteC and QwriteCV will automatically center your data ...');
- QwriteC ( 3, 1,80, -1,'(Odd breaks are shifted to the left.)');
- Delay (wait*6);
-
- QwriteC ( 7, 2,25, -1,'between margins ...');
- for row:= 9 to 21 do
- Qfill (row, 2, 15,' ',24); { Clear window }
- Delay (wait*3);
- for row:=11 to 19 do
- QwriteCV (row, 2,25, -1, Data[row-10]);
- Delay (wait*5);
-
- QwriteC ( 7, 1,80, -1,'between two columns ...');
- for row:= 9 to 21 do
- Qfill (row,29, 14,' ',24); { Clear window }
- for row:= 9 to 21 do
- Qwrite (row,40, -1,'><'); { Show two columns }
- Delay (wait*3);
- for row:=11 to 19 do
- QwriteCV (row,40,41, 12, Data[row-10]);
- Delay (wait*5);
-
- QwriteC ( 7,67,67, -1,'or on a center line ...');
- for row:=09 to 21 do
- Qwrite (row,67, 63,'|'); { Show center line }
- Delay (wait*3);
- for row:=11 to 19 do
- QwriteCV (row,67,67, -1, Data[row-10]);
- Delay (wait*10);
-
- { --- Attribute Demo --- }
- Qfill ( 1, 1, 34,' ',2000); { Clear Screen }
- Qwrite ( 2, 5, 47,'Q Screen Utilities is hiding strings on your screen ...');
- for i:= 0 to 63 do
- Qwrite ( 5, 20*i+1, 34,' Q Screen Utilities ');
- Delay (wait*6);
- Qwrite ( 3, 8, 47,'Qattr can show them - by merely changing the attribute!');
- Delay (wait*6);
- Qattr ( 5, 1, 32,1280); { Reveal Data }
- Delay (wait*5);
- Qfill ( 2, 1, -1,' ',160); { Clear Lines }
- Qwrite ( 2, 5, 46,'Or even just emphasize what you already see ...');
- for i:=1 to 500 do
- begin
- Row:= random(16) + 5;
- Col:= random(4)*20+1;
- Qattr (Row,Col, 46,20);
- Delay (3);
- Qattr (Row,Col, 32,20);
- end;
- for i:=1 to 4 do
- Qattr ( 5*i,(i-1)*20,174,20); { Emphasize Data }
- GotoRC (21, 1);
- CursorChange (OldCursor, OldCursor);
- end.