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

  1. /****************************************************************
  2.  
  3.      Turbo Prolog Toolbox
  4.      (C) Copyright 1987 Borland International.
  5.  
  6.         Demo of    menu
  7. ****************************************************************/
  8.  
  9. include "tdoms.pro"
  10. include "tpreds.pro"
  11. include "status.pro"
  12. include "menu.pro"
  13.  
  14. Predicates
  15.   test
  16.  
  17. CLAUSES
  18.   test:-
  19.     changestatus("Normal menu    Cr:Select    Esc:abort"),
  20.     menu(10,10,7,66,[first,second,third,fourth],"Normal menu",3,CHOICE),
  21.     write("You chose: ",CHOICE),nl,fail.
  22.  
  23.   test:-
  24.     changestatus("Normal menu with specified initial selection   Cr:Select    Esc:abort"),
  25.     menu(10,10,7,66,[first,second,third,fourth],"Normal menu",3,CHOICE),
  26.     write("You chose: ",CHOICE),nl,fail.
  27.  
  28.   test:-
  29.     changestatus("Use of menu without a frame    Cr:Select    Esc:abort"),
  30.     menu(10,10,112,0,[first,second,third,fourth],"No frame",2,CHOICE),
  31.     write("You chose: ",CHOICE),nl,fail.
  32.  
  33.   test:-
  34.     changestatus("Use of menu_leave    Cr:Select    Esc:abort"),
  35.     menu_leave(5,0,7,66,[first,second,third,fourth],first,1,CH1),
  36.     menu_leave(10,20,7,71,[first,second,third,fourth],second,2,CH2),
  37.     menu_leave(15,40,7,36,[first,second,third,fourth],third,3,CH3),
  38.     removewindow,removewindow,removewindow,
  39.     write("You chose: ",CH1,", ",CH2,", ",CH3),nl,fail.
  40.  
  41.   test:-
  42.     changestatus("Use of menu_mult    F10: End   Cr:Select or delete   Esc:abort"),
  43.     menu_mult(10,10,7,66,[first,second,third,fourth,fifth,"6","7"],"test",[3,6],CHOICEL),
  44.     write("You chose: ",CHOICEL),nl,fail.
  45.  
  46.   test.
  47.  
  48.   GOAL
  49.     makewindow(1,23,0,"test",0,0,24,80),
  50.     makestatus(112,"Choose a number"),
  51.     test,
  52.     changestatus("End of demo").
  53.