home *** CD-ROM | disk | FTP | other *** search
- /****************************************************************
-
- Turbo Prolog Toolbox
- (C) Copyright 1987 Borland International.
-
- Demo of boxmenu
- ****************************************************************/
-
- include "tdoms.pro"
- include "tpreds.pro"
- include "boxmenu.pro"
- include "status.pro"
-
- PREDICATES
- test
- for(INTEGER,INTEGER,INTEGER)
- str(STRING)
-
- CLAUSES
- for(X,X,_).
- for(I,A,B):-B>A,A1=A+1,for(I,A1,B).
-
- str(one).
- str(two).
- str(three).
- str(S):-for(I,4,250),str_int(S,I).
-
- test:-
- findall(X,str(X),L),
- boxmenu(0,0,18,78,7,66,L,"This is a demonstration of boxmenu",0,CHOICE),
- write("Last time you chose the number: ",CHOICE),nl,fail.
-
- test:-
- changestatus("Now choose three numbers, one from each menu"),
- findall(X,str(X),L),
- boxmenu_leave(0,0,10,50,7,32,L,"This is a demonstration of boxmenu_leave",0,CH1),
- boxmenu_leave(4,15,10,50,7,66,L,"This is a demonstration of boxmenu_leave",0,CH2),
- boxmenu_leave(8,40,10,50,7,20,L,"This is a demonstration of boxmenu_leave",0,CH3),
- removewindow,removewindow,removewindow,
- write("Last time you chose the numbers: ",CH1,", ",CH2,", ",CH3),nl,fail.
-
- test:-
- changestatus("Now choose several numbers F10:End Cr:Select or remove"),
- findall(X,str(X),L),
- boxmenu_mult(0,0,18,78,7,66,L,"This is a demonstration of boxmenu_mult",[5,10,20],CHOICEL),
- write("Last time you chose the numbers: ",CHOICEL),nl.
-
- GOAL
- makewindow(1,23,0,"",0,0,25,80),
- makewindow(1,23,0,"test",20,0,4,80),
- makestatus(112,"Choose a number and press ENTER "),
- test,
- changestatus("End of demonstration").