home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / PROGRAMS / UTILS / MOUSE / MSMOUSE2.ZIP / MENUS.ZIP / EXECUTE2.DEF < prev    next >
Encoding:
Text File  |  1989-02-10  |  4.4 KB  |  96 lines

  1. ;       SAMPLE Microsoft Mouse `EXECUTE2' MENU
  2. ;
  3. ; NOTE: Review the comments below before you compile
  4. ;       and use this source file as a mouse menu.
  5. ;
  6. ; The EXECUTE2 menu provides an example of 'semi-automatic'
  7. ; mouse menu activation.  It demonstrates how you can
  8. ; achieve subtle interaction between certain types of mouse
  9. ; menu 'event trapping' (especially with mouse motion/MATCH
  10. ; statement trapping).  This menu runs at the DOS level.
  11. ; The comments included in the source code explain the
  12. ; necessary complexity of the menu.
  13.  
  14. ; EXECUTE2 has two levels of menus.  The first menu is
  15. ; activated by clicking a mouse button, and sets up the
  16. ; conditions for entry into the second menu (horizontal
  17. ; mouse motion combined with particular screen display
  18. ; conditions).  Exiting the second menu ensures that the
  19. ; proper conditions are set up for the first menu.
  20. ;
  21. ; The major reason for this menu's complexity is the speed
  22. ; at which mouse motion trapping occurs.  If the entry and
  23. ; exit conditions around the second menu are cut down, the
  24. ; second menu may become active before the DOS 'cls'
  25. ; statement is COMPLETELY processed.  In addition, mouse
  26. ; motion in conjunction with a mouse button click within the
  27. ; second menu could cause the second menu to be redisplayed
  28. ; (this would occur if the 'cln:' "ASSIGN" statement was
  29. ; EXECUTED upon exiting menu2).
  30. ;
  31. ; When working with menus with this style of user
  32. ; interaction, ALL input and output conditions must be
  33. ; thoroughly analyzed and accommodated.  Otherwise, the
  34. ; intended entry conditions may be violated.
  35. ;
  36. ;
  37. BEGIN lb,nul,nul,nul,nul,nul,nul,32,16  ;left button is the only
  38.                                         ;entry into the initial menu
  39. ;
  40. lb:     execute menu1
  41. ;
  42. menu1: MENU   " sample 'match' function menu (1)",1,40,NORMAL
  43.        option " clear the screen, and run menu2 ",set
  44.        MEND
  45. ;
  46. set:   execute cls,asn,nul             ;'cls:' clears the screen
  47.                                        ;'asn:' reassigns the menu
  48.                                        ; entry to allow horizontal
  49.                                        ; mouse motion to trigger the
  50.                                        ; second menu.
  51.                                        ;'nul:' is a "do nothing"
  52. ;
  53. cls:   type "cls",enter
  54. asn:   ASSIGN lb,nul,nul,chk,chk,nul,nul,32,16
  55. nul:   nothing
  56. ;
  57. chk:   MATCH 2,0,NORMAL,32,res,nul     ;When horizontal mouse motion
  58.                                        ; is detected, this statement
  59.                                        ; looks for a SPACE character
  60.                                        ; at the left margin of the
  61.                                        ; second line of the display,
  62.                                        ; indicating that the DOS 'cls'
  63.                                        ; command is complete...
  64. ;
  65. res:   EXECUTE clr,menu2               ;When 'chk:' is satisfied, this
  66.                                        ; will cause the horizontal
  67.                                        ; motion sensitivity to be 
  68.                                        ; low, and reassigns all motion
  69.                                        ; trapping to a 'do nothing'
  70.                                        ; state, disallowing REENTRY
  71.                                        ; into the second menu (menu2).
  72. ;
  73. clr:   ASSIGN lb,nul,nul,nul,nul,nul,nul,5000,16
  74. menu2: MENU   " sample 'execute' function menu (2)",1,40,NORMAL
  75.        option "             do nothing            ",org
  76.        option "             do nothing            ",org
  77.        MEND
  78. ;
  79. org:   execute cln,zip                 ;This will reset the menu
  80.                                        ; parameters to the original
  81.                                        ; state at menu load-time,
  82.                                        ; and makes sure that there
  83.                                        ; is something other than
  84.                                        ; a SPACE at the left margin
  85.                                        ; of line 2 of the display
  86.                                        ; (depending on the DOS
  87.                                        ; PROMPT configuration)
  88.                                        ; - this will disallow early
  89.                                        ; entry into 'menu2' after
  90.                                        ; subsequent entry into
  91.                                        ; menu1.
  92. ;
  93. cln:   ASSIGN lb,nul,nul,nul,nul,nul,nul,32,16
  94. zip:   type enter
  95. ;
  96.