home *** CD-ROM | disk | FTP | other *** search
/ Media Share 9 / MEDIASHARE_09.ISO / clarion / ppstpx.zip / OM2.TPX < prev    next >
Text File  |  1993-06-08  |  5KB  |  120 lines

  1. #!------------------------------------------------------------------------------
  2. #!
  3. #!      OM2.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. #INSERT(%LocalPPSVariables)                    #<! Declare Variables PPS
  22.  
  23. %LocalData
  24. %ScreenStructure
  25. %PulldownStructure
  26. #EMBED('Data Section')
  27.  
  28.   CODE
  29.   ProcedureName = '%Procedure'                 #<!Fill ProcedureName var. PPS
  30.   #EMBED('Setup Procedure')
  31.   #INSERT(%FileMgrStart)                       #<!Insert File Manager. PPS
  32.   OPEN(Screen)                                 #<!Open the screen
  33.   #IF(%Pulldown)                                #!If a Pulldown exists
  34.   OPEN(%Pulldown)                              #<!Open the Pulldown
  35.   #ENDIF
  36.   #EMBED('Setup Screen')
  37.   LOOP                                         #<!Loop through screen fields
  38.     #INSERT(%GenerateFormulas)
  39.     #EMBED('Top of Accept Loop')
  40.     DISPLAY
  41.     CASE SELECTED()                            #<!Jump to field setup routine
  42.       #FOR(%ScreenField)
  43.       #IF(%ScreenFieldSetup <> %NULL)
  44.       OF %ScreenField                          #<!Edit %ScreenEditField field
  45.         %ScreenFieldSetup
  46.       #ENDIF
  47.       #ENDFOR
  48.     END                                        #<!End CASE
  49.     ACCEPT                                     #<!Enable mouse and keyboard
  50.  
  51.     CASE KEYCODE()
  52.     #FOR(%HotKey)
  53.     OF %HotKey                                   !User defined HotKey
  54.       %HotKeyProc                                !HotKey Procedure
  55.     #ENDFOR
  56.     #INSERT(%FileMgrView)                      #!Insert File Manager View PPS
  57.     END
  58.  
  59.     CASE FIELD()                               #<!Jump to field edit routine
  60.       #INSERT(%PulldownEditRoutines)
  61.       #FOR(%ScreenField)
  62.       OF %ScreenField                          #<!Edit %ScreenEditField field
  63.         %ScreenFieldEdit
  64.       #ENDFOR
  65.     END                                        #<!End CASE
  66.   END                                          #<!End LOOP
  67.   #IF(%Pulldown)                                #!If a Pulldown exists
  68.   CLOSE(%Pulldown)                             #<!Close the Pulldown
  69.   #ENDIF
  70. #EMBED('End of Procedure')
  71. #INSERT(%FileMgrExit)                          #!Insert File Manager Exit PPS
  72. #!
  73. #PROCEDURE(Pulldown,'Execute a procedure from a pulldown menu'),PULLDOWN
  74. #!------------------------------------------------------------------------------
  75. #!
  76. #!                         The Pulldown Template
  77. #!
  78. #!------------------------------------------------------------------------------
  79. #!
  80. #PROTOTYPE('')
  81. #INSERT(%StandardHeader)
  82.  
  83. %Procedure      PROCEDURE
  84.  
  85. #INSERT(%LocalPPSVariables)                    #<! Declare Variables PPS
  86.  
  87. %LocalData
  88. %PulldownStructure
  89. #EMBED('Data Section')
  90.  
  91.   CODE
  92.   ProcedureName = '%Procedure'                 #<!Fill ProcedureName var. PPS
  93.   #EMBED('Setup Procedure')
  94.   #INSERT(%FileMgrStart)                       #<!Insert File Manager. PPS
  95.   OPEN(%Pulldown)                              #<!Open the pulldown menu
  96.   #EMBED('Setup Pulldown')
  97.   LOOP
  98.     #INSERT(%GenerateFormulas)
  99.     #EMBED('Top of Accept Loop')
  100.     DISABLE(1,FIELDS())                        #<!Disable any open screen
  101.     ACCEPT                                     #<!Enable mouse and keyboard
  102.     ENABLE(1,FIELDS())                         #<!Restore any open screen
  103.     CLOSE(%Pulldown)                           #<!Close the pulldown menu
  104.     CASE KEYCODE()
  105.     #FOR(%HotKey)
  106.     OF %HotKey                                   !User defined HotKey
  107.       %HotKeyProc                                !HotKey Procedure
  108.     #ENDFOR
  109.     #INSERT(%FileMgrView)                      #!Insert File Manager View PPS
  110.     END
  111.     CASE FIELD()                               #<!Jump to selected item
  112.     #INSERT(%PulldownEditRoutines)
  113.     END                                        #<!End CASE
  114.     OPEN(%Pulldown)                            #<!Reopen the pulldown menu
  115.   END                                          #<!End LOOP
  116. #EMBED('End of Procedure')
  117. #INSERT(%FileMgrExit)                          #!Insert File Manager Exit PPS
  118. #!
  119. #CHAIN('OM3.TPX')
  120.