home *** CD-ROM | disk | FTP | other *** search
/ C!T ROM 2 / ctrom_ii_b.zip / ctrom_ii_b / PROGRAM / CLIPPER / PDHM / HM_DEMO2.PRG < prev    next >
Text File  |  1993-01-14  |  1KB  |  40 lines

  1. /*
  2.     HM_DEMO2.PRG
  3.  
  4.     Demo of how to use the [xProcess] parameter as a codeblock.  It also
  5.     demonstrates the use of these APIs:
  6.  
  7.     ADhm_current() - returns the index position of the currently highlighted
  8.         option.
  9.     ADhm_exit() - instructs the menu engine to terminate.
  10. */
  11.  
  12. //---------
  13. func main()
  14. local aMenu := { "Databases", "Utilities", "Quit" }
  15. ADhormenu( aMenu,, {|e| Xsel_handler(e)} )
  16. return nil
  17.  
  18. //------------------
  19. func Xsel_handler(e)
  20. local nSel := ADhm_current(e)
  21. local aMsg := {;
  22.                 "Selected ",;
  23.                 "Think of this message box as a major procedure that you call.",;
  24.                 "When the procedure ends, control goes back to the menu.",;
  25.                 "Note that the Esc key and the right mouse button are not active.",;
  26.                 "Typically, that's how you want them - there is a 'Quit' option.";
  27.               }
  28.  
  29. if nSel = 1
  30.     aMsg[1] += "Databases."
  31.     ADmessage( aMsg )
  32. elseif nSel = 2
  33.     aMsg[1] += "Utilities."
  34.     ADmessage( aMsg )
  35. elseif nSel = 3
  36.     ADhm_exit(e)
  37. endif
  38. return nil
  39.  
  40.