home *** CD-ROM | disk | FTP | other *** search
/ DP Tool Club 8 / CDASC08.ISO / VRAC / BP70LIB.ZIP / WINTEST.PAS < prev   
Pascal/Delphi Source File  |  1993-04-15  |  1KB  |  86 lines

  1. program wintest;
  2. uses graph,generic,graf3,graf,winlib;
  3.  
  4. const bak=11;
  5.       fill=9;
  6.  
  7.  
  8.  
  9.  
  10. procedure drawcontents(p:winptr);
  11. begin
  12. winport(p);
  13. clsgraf(14,1);
  14. saywin(100,100,10,1,2,0,1,1,1,1,1,1,'Hi',p);
  15. grafportoff;
  16. end;
  17.  
  18.  
  19.  
  20.  
  21.  
  22.  
  23.  
  24. procedure runcontents(p:winptr);
  25. begin
  26. beep(1000,50);
  27. end;
  28.  
  29.  
  30.  
  31.  
  32. var p:winptr; dproc:procedure; w:winrec;
  33. begin
  34. randomize;   { needed for random stars in clsstars }
  35. grafon;
  36. resetmouse;
  37. p:=nil;
  38. clsgraf(bak,fill);
  39. with w do
  40.      begin
  41.      x1:=300;
  42.      y1:=300;
  43.      x2:=700;
  44.      y2:=700;
  45.      width:=700;
  46.      height:=700;
  47.      wintype:=1;
  48.      zoom:=0;
  49.      wincol:=7;
  50.      scrollcol:=7;
  51.      btncol:=7;
  52.      btntxt:=14;
  53.      titletxt:=11;
  54.      titlebak:=8;
  55.      scrollrate:=1;
  56.      ox1:=x1;
  57.      ox2:=x2;
  58.      oy1:=y1;
  59.      oy2:=y2;
  60.      ix:=100;
  61.      iy:=100;
  62.      xoff:=0;
  63.      yoff:=0;
  64.      title:='WinLib Window';
  65.      next:=nil;
  66.      data:=nil;
  67.      redraw:=false;
  68.      end;
  69. openwin(p,w);
  70. drawwin(p);
  71. drawcontents(p);
  72. sm;
  73. repeat
  74.       if mousebutton<>0 then
  75.          begin
  76.          hm;
  77.          if runwin(p,p,bak,fill,drawcontents,runcontents,true) then
  78.             begin
  79.             closewin(p,p);
  80.             closegraph;
  81.             halt;
  82.             end;
  83.          sm;
  84.          end;
  85.       until false;
  86. end.