home *** CD-ROM | disk | FTP | other *** search
/ High Voltage Shareware / high1.zip / high1 / DIR2 / CLATPL.ZIP / CLARION2.TPX < prev    next >
Text File  |  1993-07-26  |  4KB  |  108 lines

  1. #!------------------------------------------------------------------------------
  2. #!
  3. #!      CLARION2.TPX
  4. #!
  5. #!      Menu      Execute a procedure from a pop-up menu
  6. #!      Pulldown  Execute a procedure from a pulldown menu
  7. #!
  8. #!------------------------------------------------------------------------------
  9. #!
  10. #PROCEDURE(Menu,'Execute a procedure from a pop-up menu'),SCREEN,PULLDOWN
  11. #!------------------------------------------------------------------------------
  12. #!
  13. #!                           The Menu Template
  14. #!
  15. #!------------------------------------------------------------------------------
  16. #PROTOTYPE('')
  17. #INSERT(%StandardHeader)
  18.  
  19. %Procedure      PROCEDURE
  20.  
  21. %LocalData
  22. %ScreenStructure
  23. %PulldownStructure
  24. #EMBED('Data Section')
  25.  
  26.   CODE
  27.   #EMBED('Setup Procedure')
  28.   OPEN(Screen)                                 #<!Open the screen
  29.   #IF(%Pulldown)                                #!If a Pulldown exists
  30.   OPEN(%Pulldown)                              #<!Open the Pulldown
  31.   #ENDIF
  32.   #EMBED('Setup Screen')
  33.   LOOP                                         #<!Loop through screen fields
  34.     #INSERT(%GenerateFormulas)
  35.     #EMBED('Top of Accept Loop')
  36.     DISPLAY
  37.     CASE SELECTED()                            #<!Jump to field setup routine
  38.       #FOR(%ScreenField)
  39.       #IF(%ScreenFieldSetup <> %NULL)
  40.       OF %ScreenField                          #<!Edit %ScreenEditField field
  41.         %ScreenFieldSetup
  42.       #ENDIF
  43.       #ENDFOR
  44.     END                                        #<!End CASE
  45.     ACCEPT                                     #<!Enable mouse and keyboard
  46.  
  47.     CASE KEYCODE()
  48.     #FOR(%HotKey)
  49.     OF %HotKey                                   !User defined HotKey
  50.       %HotKeyProc                                !HotKey Procedure
  51.     #ENDFOR
  52.     END
  53.  
  54.     CASE FIELD()                               #<!Jump to field edit routine
  55.       #INSERT(%PulldownEditRoutines)
  56.       #FOR(%ScreenField)
  57.       OF %ScreenField                          #<!Edit %ScreenEditField field
  58.         %ScreenFieldEdit
  59.       #ENDFOR
  60.     END                                        #<!End CASE
  61.   END                                          #<!End LOOP
  62.   #IF(%Pulldown)                                #!If a Pulldown exists
  63.   CLOSE(%Pulldown)                             #<!Close the Pulldown
  64.   #ENDIF
  65. #EMBED('End of Procedure')
  66. #!
  67. #PROCEDURE(Pulldown,'Execute a procedure from a pulldown menu'),PULLDOWN
  68. #!------------------------------------------------------------------------------
  69. #!
  70. #!                         The Pulldown Template
  71. #!
  72. #!------------------------------------------------------------------------------
  73. #!
  74. #PROTOTYPE('')
  75. #INSERT(%StandardHeader)
  76.  
  77. %Procedure      PROCEDURE
  78.  
  79. %LocalData
  80. %PulldownStructure
  81. #EMBED('Data Section')
  82.  
  83.   CODE
  84.   #EMBED('Setup Procedure')
  85.   OPEN(%Pulldown)                              #<!Open the pulldown menu
  86.   #EMBED('Setup Pulldown')
  87.   LOOP
  88.     #INSERT(%GenerateFormulas)
  89.     #EMBED('Top of Accept Loop')
  90.     DISABLE(1,FIELDS())                        #<!Disable any open screen
  91.     ACCEPT                                     #<!Enable mouse and keyboard
  92.     ENABLE(1,FIELDS())                         #<!Restore any open screen
  93.     CLOSE(%Pulldown)                           #<!Close the pulldown menu
  94.     CASE KEYCODE()
  95.     #FOR(%HotKey)
  96.     OF %HotKey                                   !User defined HotKey
  97.       %HotKeyProc                                !HotKey Procedure
  98.     #ENDFOR
  99.     END
  100.     CASE FIELD()                               #<!Jump to selected item
  101.     #INSERT(%PulldownEditRoutines)
  102.     END                                        #<!End CASE
  103.     OPEN(%Pulldown)                            #<!Reopen the pulldown menu
  104.   END                                          #<!End LOOP
  105. #EMBED('End of Procedure')
  106. #!
  107. #CHAIN('CLARION3.TPX')
  108.