home *** CD-ROM | disk | FTP | other *** search
/ Collection of Hack-Phreak Scene Programs / cleanhpvac.zip / cleanhpvac / GFXFX2.ZIP / TESTTXT.PAS < prev    next >
Pascal/Delphi Source File  |  1995-02-14  |  2KB  |  63 lines

  1.  
  2. program test_txt_unit; { TESTTXT.PAS }
  3. { General demonstration of the procs and function of the txt-unit.
  4.   Press a key to continue between the screens.
  5.   By Bas van Gaalen }
  6. uses u_txt,u_misc,u_kb;
  7. var
  8.   backuppal:array[1..15] of record r,g,b:byte; end;
  9.   x,y:byte;
  10. begin
  11.   clrscr;
  12.   cursoroff;
  13.  
  14.   { hi-intensity demo }
  15.   for y:=0 to 15 do
  16.     for x:=0 to 15 do
  17.       dspat(' x ',3*x,y,y*16+x);
  18.   waitkey(0);
  19.   setblink(off); { blink off, hi-intensity on }
  20.   waitkey(0);
  21.   setblink(on); { blink on, hi-intensity off }
  22.  
  23.   { special setrgb procedure for textmode - set gray-scale palette }
  24.  
  25.   for x:=1 to 15 do begin
  26.     txt_getrgb(x,backuppal[x].r,backuppal[x].g,backuppal[x].b); { backup }
  27.     txt_setrgb(x,x*63 div 16,x*63 div 16,x*63 div 16); { set new }
  28.   end;
  29.   dspat('txt_setrgb demo...',0,16,15);
  30.   waitkey(0);
  31.   setblink(off); { blink off, hi-intensity on }
  32.   waitkey(0);
  33.   setblink(on); { blink on, hi-intensity off }
  34.   for x:=1 to 15 do
  35.     txt_setrgb(x,backuppal[x].r,backuppal[x].g,backuppal[x].b); { restore }
  36.  
  37.   { txt_lines demo - also check SWITCH.PAS }
  38.   dspat('Current screen resolution: '+lz(cols,0)+'x'+lz(rows,0),0,17,lightgray);
  39.   waitkey(0);
  40.   txt_lines(28);
  41.   dspat('Current screen resolution: '+lz(cols,0)+'x'+lz(rows,0),0,18,lightgray);
  42.   waitkey(0);
  43.   txt_lines(50);
  44.  
  45.   { display-routines demo }
  46.   dspat('dpat: display at - displays string of given color at given place',0,20,lightblue);
  47.   for x:=1 to 15 do fillattr(x*3,21,x*3+2,21,x);
  48.   dsptxt('dpstxt: display text at - display text string only, no color, at given place',0,21);
  49.   dspmul(#0#7+'dspmul: display '+#0#9+'multi'+#0#11+'color'+#0#7+' text at given position',0,22);
  50.  
  51.   { cursor }
  52.   linecursor;
  53.   dspat('Normal cursor:',0,24,lightgray); placecursor(15,24); readln;
  54.   halfcursor;
  55.   dspat('  Half cursor:',0,25,lightgray); placecursor(15,25); readln;
  56.   blockcursor;
  57.   dspat('Insert cursor:',0,26,lightgray); placecursor(15,26); readln;
  58.   cursoroff;
  59.  
  60.   dspat('For more of an implicit demonstration check PV.PAS',0,28,lightcyan);
  61.   waitkey(0);
  62. end.
  63.