home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / PASCAL / QWIK13.ZIP / QDEMO.PAS < prev    next >
Encoding:
Pascal/Delphi Source File  |  1986-11-10  |  4.3 KB  |  129 lines

  1. { Qdemo.pas - Demonstration program for Q screen utilities  ver 1.3, 11-10-86 }
  2. {$I qwik13.inc}
  3.  
  4. var Row,Rows,Col,Cols,Step,Rstep,Cstep,
  5.     RowEdge,RowMax,ColEdge,ColMax,Count,Attrib,i,wait: integer;
  6.     HideCursor,OldCursor,Fgrnd,Bgrnd: integer;
  7.     Strng: String[75];
  8.     Data: array [1..9] of String[80];
  9.  
  10. begin
  11. { --- Set up data --- }
  12.   ToEGA:=EGAcheck;           { << <<  Required intializing statement !! }
  13.   Wait:= 500;
  14.   HideCursor:=8192;
  15.   Strng:= ' Q Screen Utilities ';
  16.   Data[1]:= '1';
  17.   Data[2]:= '22';
  18.   Data[3]:= '333';
  19.   Data[4]:= Strng;
  20.   Data[5]:= 'Odd  Length';
  21.   Data[6]:= 'Even  Length';
  22.   Data[7]:= '18 characters wide';
  23.   Data[8]:= '19 characters width';
  24.   Data[9]:= 'Margin to Margin width';
  25.  
  26. { --- Initial screen --- }
  27.   CursorChange (HideCursor, OldCursor);
  28.   Qfill    ( 1, 1, 31,' ',2000);       {  Clear Screen }
  29.   QwriteCV (11, 1,80, 30, Strng);
  30.   QwriteC  (13, 1,80, -1,'10,000 fills to your screen.');
  31.   QwriteC  (14, 1,80, -1,'Hold on to your seat ...');
  32.   Delay    (Wait*5);
  33.  
  34. { --- Explosion of Boxes --- }
  35.   Qfill    (11, 1, -1,' ',320);        {  Clear Lines }
  36.   Qattr    ( 1, 1,112,2000);           {  Change screen attribute }
  37.   for step:=2 to 40 do
  38.   begin
  39.     if Step>24 then Rstep:=12 else Rstep:=Step div 2;
  40.     RowMax:= 13 + Rstep;
  41.     ColMax:= 40 + Step;
  42.     for Count:=1 to 25 do
  43.     begin
  44.       Row:= 13 - Rstep + random(Rstep+Rstep+1);
  45.       Rows:= Rstep;
  46.       RowEdge:= Row + Rows;
  47.       if RowEdge>RowMax then Rows:= RowMax-Row+1;
  48.       Col:= 40 - step + random(step+step+1);
  49.       Cols:= Rstep + Rstep + Rstep shr 2;
  50.       ColEdge:= Col + Cols;
  51.       if ColEdge>ColMax then Cols:= ColMax-Col+1;
  52.       Fgrnd:= random (16);
  53.       Bgrnd:= random (8);
  54.       if Bgrnd=Fgrnd then Fgrnd:=Fgrnd + 1;
  55.       Attrib:= (Bgrnd shl 4) + Fgrnd;
  56.       for i:=0 to Rows-1 do
  57.         Qfill (Row+i,Col,Attrib,#178,Cols);
  58.     end
  59.   end;
  60.   for i:=1 to 6 do
  61.     Qfill ( 9+i,24, 64,' ',34);
  62.   for i:=1 to 4 do
  63.     Qfill (10+i,26,110,' ',30);
  64.   QwriteCV(12, 1,80, 78, Strng);
  65.   QwriteC (13, 1,80, 78,' Version 1.3 ');
  66.   Delay   (Wait*6);
  67.   Qwrite  ( 8, 3, 31,'Qwrite will write with new attributes that you specify direct to the screen.');
  68.   Delay   (Wait*6);
  69.   Qwrite  (17, 3, -1,'Qwrite will also use existing attributes when you do not even know or care.');
  70.   Qattr   (17,24,199,8);               { highlight the word 'existing' }
  71.   Delay   (wait*10);
  72.  
  73. { --- Centering Demo --- }
  74.   Qfill   ( 1, 1, 48,' ',2000);        {  Clear Screen }
  75.   QwriteC ( 2, 1,80, -1,'QwriteC and QwriteCV will automatically center your data ...');
  76.   QwriteC ( 3, 1,80, -1,'(Odd breaks are shifted to the left.)');
  77.   Delay   (wait*6);
  78.  
  79.   QwriteC ( 7, 2,25, -1,'between margins ...');
  80.   for row:= 9 to 21 do
  81.     Qfill   (row, 2, 15,' ',24);       {  Clear window }
  82.   Delay   (wait*3);
  83.   for row:=11 to 19 do
  84.     QwriteCV (row, 2,25, -1, Data[row-10]);
  85.   Delay   (wait*5);
  86.  
  87.   QwriteC ( 7, 1,80, -1,'between two columns ...');
  88.   for row:= 9 to 21 do
  89.     Qfill   (row,29, 14,' ',24);       {  Clear window }
  90.   for row:= 9 to 21 do
  91.     Qwrite  (row,40, -1,'><');         {  Show two columns  }
  92.   Delay   (wait*3);
  93.   for row:=11 to 19 do
  94.     QwriteCV (row,40,41, 12, Data[row-10]);
  95.   Delay   (wait*5);
  96.  
  97.   QwriteC ( 7,67,67, -1,'or on a center line ...');
  98.   for row:=09 to 21 do
  99.     Qwrite  (row,67, 63,'|');          {  Show center line  }
  100.   Delay   (wait*3);
  101.   for row:=11 to 19 do
  102.     QwriteCV (row,67,67, -1, Data[row-10]);
  103.   Delay   (wait*10);
  104.  
  105. { --- Attribute Demo --- }
  106.   Qfill   ( 1, 1, 34,' ',2000);        {  Clear Screen }
  107.   Qwrite  ( 2, 5, 47,'Q Screen Utilities is hiding strings on your screen ...');
  108.   for i:= 0 to 63 do
  109.     Qwrite ( 5, 20*i+1, 34,' Q Screen Utilities ');
  110.   Delay   (wait*6);
  111.   Qwrite  ( 3, 8, 47,'Qattr can show them - by merely changing the attribute!');
  112.   Delay   (wait*6);
  113.   Qattr   ( 5, 1, 32,1280);            {  Reveal Data }
  114.   Delay   (wait*5);
  115.   Qfill  ( 2, 1, -1,' ',160);          {  Clear Lines }
  116.   Qwrite  ( 2, 5, 46,'Or even just emphasize what you already see ...');
  117.   for i:=1 to 500 do
  118.   begin
  119.     Row:= random(16) + 5;
  120.     Col:= random(4)*20+1;
  121.     Qattr (Row,Col, 46,20);
  122.     Delay (3);
  123.     Qattr (Row,Col, 32,20);
  124.   end;
  125.   for i:=1 to 4 do
  126.     Qattr   ( 5*i,(i-1)*20,174,20);    {  Emphasize Data }
  127.   GotoRC  (21, 1);
  128.   CursorChange (OldCursor, OldCursor);
  129. end.