home *** CD-ROM | disk | FTP | other *** search
/ Simtel MSDOS - Coast to Coast / simteldosarchivecoasttocoast2.iso / turbopas / graphtxt.zip / GRAPHTXT.DEM next >
Text File  |  1990-02-16  |  2KB  |  93 lines

  1. {
  2.  
  3.     graphtxt.dem
  4.     2-16-1990
  5.     Compile and run under TP 5.5.
  6.  
  7.     John W. Small
  8.  
  9.     PSW / Power SoftWare
  10.     P.O. Box 10072
  11.     McLean, Virginia 22102 8072
  12.     (703) 759-3838
  13.  
  14. }
  15.  
  16. program graphtxtDemo;
  17.  
  18. uses graph, graphtxt;
  19.  
  20. var driver, mode, error, dx, dy, c : integer;
  21.     istr : string;
  22. begin
  23.  
  24.     driver := detect;
  25.     InitGraph(driver,mode,'');
  26.     error := GraphResult;
  27.     if error <> grOk then begin
  28.         writeln('Graphics error: ',GraphErrorMsg(error));
  29.         halt
  30.         end;
  31.     InitGraphText;
  32.  
  33.     dx := GetMaxX div (GetMaxColor+1);
  34.     ClearViewPort;
  35.     for c := 0 to GetMaxColor do begin
  36.         SetFillStyle(XHatchFill,c);
  37.         bar3d(c*dx,0,(c+1)*dx,GetMaxY,0,false);
  38.         end;
  39.     SetTextJustify(LeftText,TopText);
  40.     SetTextStyle(TriplexFont,HorizDir,4);
  41.     writeln('Include graphtxt in your "uses" clause.');
  42.     writeln('Call "InitGraphText" after "InitGraph()"');
  43.     writeln('to have complete writeln and readln');
  44.     writeln('capabilities in all graphics modes.');
  45.     writeln;
  46.     writeln('Let''s try readln.');
  47.     write('Enter : ');
  48.     readln(istr);
  49.  
  50.     SetBkColor(BLUE);
  51.     SetColor(WHITE);
  52.     ClearViewPort;
  53.     SetTextStyle(SansSerifFont,VertDir,4);
  54.     SetTextJustify(LeftText,BottomText);
  55.     MoveTo(0,GetMaxY);
  56.     writeln('It even works with');
  57.     writeln('vertical text.');
  58.     writeln;
  59.     write('Let''s try readln : ');
  60.     readln(istr);
  61.     ClearViewPort;
  62.     SetTextStyle(GothicFont,HorizDir,4);
  63.     SetTextJustify(LeftText,TopText);
  64.     writeln('Besure to call "CloseGraphText"');
  65.     writeln('before calling "CloseGraph."');
  66.  
  67.     SetTextJustify(CenterText,TopText);
  68.     MoveTo(GetMaxX div 2,GetMaxY div 2);
  69.     writeln('Goodbye time');
  70.     writeln('consuming graphic');
  71.     writeln('text programming!');
  72.     writeln;
  73.     writeln('Press enter to continue.');
  74.     readln;
  75.     CloseGraphText;
  76.     CloseGraph;
  77.  
  78.     writeln('If you find graphtxt useful and are using it in your');
  79.     writeln('applications, a registration fee of $7 is requested.');
  80.     writeln('Upon registration you will be sent source code and the');
  81.     writeln('latest examples programs on a DOS formatted 5 1/4" disk.');
  82.     writeln;
  83.     writeln('PSW / Power SoftWare');
  84.     writeln('P.O. Box 10072');
  85.     writeln('McLean, Virginia 22102 8072');
  86.     writeln('(703) 759-3838');
  87.     writeln;
  88.     writeln('That''s all folks!');
  89.     writeln;
  90.     writeln('Press enter to quit.');
  91.     readln;
  92.  
  93. end.