home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 9 / 09.iso / l / l216 / 2.ddi / XLONGMNU.PRO < prev    next >
Encoding:
Text File  |  1987-03-23  |  2.0 KB  |  68 lines

  1. /****************************************************************
  2.  
  3.      Turbo Prolog Toolbox
  4.      (C) Copyright 1987 Borland International.
  5.  
  6.         Demo of    longmenu
  7. ****************************************************************/
  8.  
  9. include "tdoms.pro"
  10. include "tpreds.pro"
  11. include "longmenu.pro"
  12. include "status.pro"
  13.  
  14. Predicates
  15.   test
  16.   for(INTEGER,INTEGER,INTEGER)
  17.   str(STRING)
  18.  
  19. CLAUSES
  20.   for(X,X,_).
  21.   for(I,A,B):-B>A,A1=A+1,for(I,A1,B).
  22.  
  23.   str(first).
  24.   str(second).
  25.   str(third).
  26.   str(S):-for(I,4,50),str_int(S,I).
  27.  
  28.   test:-
  29.     changestatus("Lmenu is used to select from more than 23 alternatives    Cr:Select    Esc:abort"),
  30.     findall(X,str(X),L),
  31.     longmenu(10,10,5,7,66,L,"longmenu",10,CHOICE),
  32.     write("Last time you chose: ",CHOICE),nl,fail.
  33.  
  34.   test:-
  35.     changestatus("longmenu with pre-selected starting point for the cursor   Cr:Select    Esc:abort"),
  36.     findall(X,str(X),L),
  37.     longmenu(10,10,5,7,66,L,"longmenu",3,CHOICE),
  38.     write("Last time you chose: ",CHOICE),nl,fail.
  39.  
  40.   test:-
  41.     changestatus("Using longmenu to create an unframed menu    Cr:Select    Esc:abort"),
  42.     findall(X,str(X),L),
  43.     longmenu(10,10,5,112,0,L,"This message will not be visible",20,CHOICE),
  44.     write("Last time you chose: ",CHOICE),nl,fail.
  45.  
  46.   test:-
  47.     changestatus("Lmenu_leave: make one selection from each menu displayed  Cr:Select Esc:abort"),
  48.     findall(X,str(X),L),
  49.     longmenu_leave(5,0,5,7,66,L,first,1,CH1),
  50.     longmenu_leave(10,20,5,7,71,L,second,22,CH2),
  51.     longmenu_leave(15,40,5,7,36,L,third,33,CH3),
  52.     removewindow,removewindow,removewindow,
  53.     write("Last time you chose: ",CH1,", ",CH2,", ",CH3),nl,fail.
  54.  
  55.   test:-
  56.     changestatus("Longmenu_mult allows multiple selections  F10:End Cr:(Un) select  Esc:abort"),
  57.     findall(X,str(X),L),
  58.     longmenu_mult(10,10,5,7,66,L,"test",[2],CHOICEL),
  59.     write("Last time you chose: ",CHOICEL),nl,fail.
  60.   test.
  61.  
  62. GOAL
  63.     makewindow(1,23,0,"test",0,0,24,80),
  64.     write("Use cursor keys to inspect the rest of the menu items\n\n"),
  65.     makestatus(112,"Choose a number"),
  66.     test,
  67.     changestatus("End of demo").
  68.