home *** CD-ROM | disk | FTP | other *** search
- Program test;
- { $M 1024,0,655360 }
- uses crt,graph,mcmenu10,mcmice10,mcxms10;
-
- const
- y=true;
- n=false;
-
- st1:StLine=(ni:2;pt:nil;
- its:((u:y;ltext:'Alt-X';rtext:'Exit';code:1045;enable:y),
- (u:y;ltext:'F2';rtext:'Play';code:1060;enable:y),
- (u:n),(u:n),(u:n)));
-
- var
- i,j:integer;
- ff:fname;
- pm:awin;
- codest:word;
- code:byte;
-
-
- begin
- {Initialization of graphic}
- i:=4;j:=1;
- initgraph(i,j,'d:\tp60\bgi');
- newpalete(1,7,0,0,8,4);
-
- {Initialization of XMS heap}
- InitXMS(init_xms);
-
- {Reading window(menu) definition from file}
- ff.s:='setup.dat';
- ff.chg:=false; {if TRUE you can choose another file from the list}
- LoadWin(ff,2,pm);
- if ff.io = false then begin
- closegraph;
- halt(1);
- end;
-
- putstline(st1);
-
- {Set of help}
- pm[1]^.hlp:=pm[2];
-
- {Vertical menu}
- putwin(pm[1]^);
- repeat
- handleall(pm[1]^,code,st1,codest);
- if (code=1) and (init_mouse<>0) then begin
- setgrcrsr(5,0,pointinghand);
- crsr(true);
- setmpos(pm[1]^.x,pm[1]^.y);
- repeat
- if pressedbutton(1) then begin
- crsr(false);
- delwin(pm[1]^);
- whererelease(1,pm[1]^.x,pm[1]^.y);
- putwin(pm[1]^);
- crsr(true);
- end;
- until pressedbutton(2);
- crsr(false);
- end;
- if codest=1060 then begin
- sound(300); delay(100); nosound;
- end;
- until (code=7) or (codest=1045);
- delwin(pm[1]^);
- delstline(st1);
-
- {Save definitions to file}
- ff.chg:=false; {if TRUE you can choose file you want to write in
- or use new file}
- SaveWin(ff,2,pm);
-
-
- CloseGraph;
- end.
-
-
-