home *** CD-ROM | disk | FTP | other *** search
/ Power Programming / powerprogramming1994.iso / progtool / borland / jnfb88.arc / PDOWN.ARC / STPMEX.PRO < prev   
Text File  |  1987-10-09  |  4KB  |  110 lines

  1. /****************************************************************
  2.  
  3.      Example using the pull-down menu tools with status
  4.      bar update.
  5.  
  6. ****************************************************************/
  7.  
  8. include "tdoms.pro"
  9.  
  10.  
  11. DATABASE
  12.   pdwstate(ROW,COL,SYMBOL,ROW,COL)
  13.  
  14. include "tpreds.pro"
  15. include "status.pro"
  16. include "spulldwn.pro"    /* modified pull-down menu package */
  17.  
  18. Predicates
  19.   msg(ROW,COL,STRING)
  20.  
  21. CLAUSES
  22.  
  23. /* After a menu item is selected, one of the corresponding actions
  24.    is chosen.
  25. */   
  26.    /* The file pull-down menu options */
  27.  
  28.   pdwaction(1,1):-msg(3,10,"Load file selected").
  29.   pdwaction(1,2):-msg(4,10,"Save file selected").
  30.   pdwaction(1,3):-msg(5,10,"Directory selected").
  31.   pdwaction(1,4):-msg(6,10,"Print selected").
  32.   pdwaction(1,5):-msg(7,10,"Copy selected").
  33.   pdwaction(1,6):-msg(8,10,"Rename selected").
  34.   pdwaction(1,7):-msg(9,10,"Operating system selected").
  35.  
  36.    /* The Run menu */
  37.   
  38.   pdwaction(2,0):-msg(3,25,"Run selected").
  39.   
  40.    /* The Help pull-down menu options */ 
  41.   
  42.   pdwaction(3,1):-msg(3,40,"Topic selected").
  43.   pdwaction(3,2):-msg(4,40,"Edit selected").
  44.   pdwaction(3,3):-msg(5,40,"Run selected").
  45.   pdwaction(3,4):-msg(6,40,"Options selected").
  46.   pdwaction(3,5):-msg(7,40,"Quick help selected").
  47.  
  48.    /* The options pull-down menu options */
  49.   
  50.   pdwaction(4,1):-msg(3,44,"Screen selected").
  51.   pdwaction(4,2):-msg(4,44,"Printer selected").
  52.   pdwaction(4,3):-msg(5,44,"Mouse selected").
  53.   pdwaction(4,4):-msg(6,44,"Options macros").
  54.   
  55.    /* The Quit menu */
  56.   
  57.   pdwaction(5,0):-exit.
  58.  
  59.   msg(R,C,S):-
  60.         makestatus(112,"Press any key"),
  61.     makewindow(1,7,7,"Message Window",R,C,5,30),
  62.     window_str(S),
  63.     readkey(_),
  64.     removewindow,
  65.     removestatus.
  66.  
  67. GOAL
  68. /*
  69.           1         2         3         4         5         6
  70. 0123456789012345678901234567890123456789012345678901234567890123456789
  71.      Files          Run            Help         Setup          Quit
  72. */
  73.  
  74.   makewindow(1,7,0,"",0,0,24,80),
  75.   makestatus(112," Select with arrows or use first upper
  76.                    case letter"),
  77.   spulldown(7,
  78.       [ curtain(5,"Files",["Load","Save","Directory","Print",
  79.                            "Copy","Rename","Operating System"]),
  80.         curtain(20,"Run",[]),
  81.             curtain(35,"Help"    ,["Select topic","Edit","Run",
  82.                                   "Options","Quick help"]),
  83.             curtain(48,"Setup"     ,["Screen","Printer", "Mouse",
  84.                                      "Macros"]),
  85.             curtain(63,"Quit"      ,[])
  86.           ],
  87.           [ stat("Select for file options",
  88.                 ["Load a new file",
  89.                  "Save Current file to disk",
  90.                  "View current directory",
  91.                  "Print current file",
  92.                  "Make a copy of current file",
  93.                  "Rename file",
  94.                  "Execute DOS commands"]),
  95.             stat("Execute a program",[]),
  96.             stat("Select for help",["Specify a topic", 
  97.                  "Get help about the editor",  
  98.                  "Get help on running a program",
  99.                  "Get help on the systems options",
  100.                  "Get the quick guide"]),
  101.             stat("Select to setup the system", ["Setup the screen",
  102.                  "Setup the printer", "Setup the mouse",
  103.                  "Setup macros"]),
  104.             stat("Select to exit the program", [])   
  105.           ]  
  106.                         ,CH,SUBCH ),
  107.            write("\n    CH = ",CH),
  108.            write("\n SUBCH = ",SUBCH),nl.
  109.  
  110.