home *** CD-ROM | disk | FTP | other *** search
/ QBasic & Borland Pascal & C / Delphi5.iso / Pascal / Samples / MCUNIT10.ARJ / TEST.PAS < prev   
Encoding:
Pascal/Delphi Source File  |  1993-02-17  |  1.7 KB  |  81 lines

  1. Program test;
  2. { $M 1024,0,655360 }
  3. uses crt,graph,mcmenu10,mcmice10,mcxms10;
  4.  
  5. const
  6.   y=true;
  7.   n=false;
  8.  
  9.   st1:StLine=(ni:2;pt:nil;
  10.         its:((u:y;ltext:'Alt-X';rtext:'Exit';code:1045;enable:y),
  11.              (u:y;ltext:'F2';rtext:'Play';code:1060;enable:y),
  12.              (u:n),(u:n),(u:n)));
  13.  
  14. var
  15.   i,j:integer;
  16.   ff:fname;
  17.   pm:awin;
  18.   codest:word;
  19.   code:byte;
  20.  
  21.  
  22. begin
  23.   {Initialization of graphic}
  24.   i:=4;j:=1;
  25.   initgraph(i,j,'d:\tp60\bgi');
  26.   newpalete(1,7,0,0,8,4);
  27.  
  28.   {Initialization of XMS heap}
  29.   InitXMS(init_xms);
  30.  
  31.   {Reading window(menu) definition from file}
  32.   ff.s:='setup.dat';
  33.   ff.chg:=false;   {if TRUE you can choose another file from the list}
  34.   LoadWin(ff,2,pm);
  35.   if ff.io = false then begin
  36.     closegraph;
  37.     halt(1);
  38.   end;
  39.  
  40.   putstline(st1);
  41.  
  42.   {Set of help}
  43.   pm[1]^.hlp:=pm[2];
  44.  
  45.   {Vertical menu}
  46.   putwin(pm[1]^);
  47.   repeat
  48.     handleall(pm[1]^,code,st1,codest);
  49.     if (code=1) and (init_mouse<>0) then begin
  50.       setgrcrsr(5,0,pointinghand);
  51.       crsr(true);
  52.       setmpos(pm[1]^.x,pm[1]^.y);
  53.       repeat
  54.         if pressedbutton(1) then begin
  55.           crsr(false);
  56.           delwin(pm[1]^);
  57.           whererelease(1,pm[1]^.x,pm[1]^.y);
  58.           putwin(pm[1]^);
  59.           crsr(true);
  60.         end;
  61.       until pressedbutton(2);
  62.       crsr(false);
  63.     end;
  64.     if codest=1060 then begin
  65.       sound(300); delay(100); nosound;
  66.     end;
  67.   until (code=7) or (codest=1045);
  68.   delwin(pm[1]^);
  69.   delstline(st1);
  70.  
  71.   {Save definitions to file}
  72.   ff.chg:=false;     {if TRUE you can choose file you want to write in
  73.                       or use new file}
  74.   SaveWin(ff,2,pm);
  75.  
  76.  
  77.   CloseGraph;
  78. end.
  79.  
  80.  
  81.