home *** CD-ROM | disk | FTP | other *** search
/ DP Tool Club 16 / CD_ASCQ_16_0994.iso / news / 4611 / fw16d.ins / INCLUDE / MENU.CH < prev    next >
Text File  |  1994-06-09  |  3KB  |  84 lines

  1. #ifndef _MENU_CH
  2. #define _MENU_CH
  3.  
  4. //----------------------------------------------------------------------------//
  5. // Creating PullDown Menus from source code
  6.  
  7. #xcommand MENU [ <oMenu> ] ;
  8.              [ <popup: POPUP> ] ;
  9.        => ;
  10.           [ <oMenu> := ] MenuBegin( <.popup.> )
  11.  
  12. #xcommand MENUITEM [ <oMenuItem> PROMPT ] [<cPrompt>] ;
  13.              [ MESSAGE <cMsg> ] ;
  14.              [ <checked: CHECK, CHECKED, MARK> ] ;
  15.              [ <enable: ENABLED, DISABLED> ] ;
  16.              [ <file: FILE, FILENAME, DISK> <cBmpFile> ] ;
  17.              [ <resource: RESOURCE, RESNAME, NAME> <cResName> ] ;
  18.              [ ACTION <uAction> ] ;
  19.              [ BLOCK <bAction> ] ;
  20.              [ <of: OF, MENU, SYSMENU> <oMenu> ] ;
  21.              [ ACCELERATOR <nState>, <nVirtKey> ] ;
  22.        => ;
  23.           [ <oMenuItem> := ] MenuAddItem( <cPrompt>, <cMsg>,;
  24.              <.checked.>, [ Upper(<(enable)>) == "ENABLED" ], <{uAction}>,;
  25.              <cBmpFile>, <cResName>, <oMenu>, <bAction>, <nState>, <nVirtKey> )
  26.  
  27. #xcommand SEPARATOR => MenuAddItem()
  28.  
  29. #xcommand ENDMENU => MenuEnd()
  30.  
  31. //----------------------------------------------------------------------------//
  32. // Creating PullDown Menus from resources
  33.  
  34. #xcommand DEFINE MENU <oMenu> ;
  35.              [ <res: RESOURCE, NAME, RESNAME> <cResName> ] ;
  36.              [ <popup: POPUP> ] ;
  37.        => ;
  38.           <oMenu> := TMenu():ReDefine( <cResName>, <.popup.> )
  39.  
  40. #xcommand REDEFINE MENUITEM [ <oMenuItem> PROMPT <cPrompt> ] ;
  41.              [ ID <nId> <of: OF, MENU> <oMenu> ] ;
  42.              [ ACTION <uAction> ] ;
  43.              [ BLOCK  <bAction> ] ;
  44.              [ MESSAGE <cMsg> ] ;
  45.              [ <checked: CHECK, CHECKED, MARK> ] ;
  46.              [ <enable: ENABLED, DISABLED> ] ;
  47.              [ <file: FILE, FILENAME, DISK> <cBmpFile> ] ;
  48.              [ <resource: RESOURCE, RESNAME, NAME> <cResName> ] ;
  49.              [ ACCELERATOR <nState>, <nVirtKey> ] ;
  50.        => ;
  51.           [ <oMenuItem> := ] TMenuItem():ReDefine( <cPrompt>, <cMsg>,;
  52.              <.checked.>, [ Upper(<(enable)>) == "ENABLED" ], <{uAction}>,;
  53.              <cBmpFile>, <cResName>, <oMenu>, <bAction>, <nId>,;
  54.              <nState>, <nVirtKey>  )
  55.  
  56. //----------------------------------------------------------------------------//
  57.  
  58. #xcommand DEFINE MENU <oMenu> OF <oWnd> ;
  59.        => ;
  60.           <oMenu> := TMenu():New( .f., <oWnd> )
  61.  
  62. #xcommand SET MENU OF <oWnd> TO <oMenu> => <oWnd>:SetMenu( <oMenu> )
  63.  
  64. //----------------------------------------------------------------------------//
  65. // PopUps Management
  66.  
  67. #xcommand ACTIVATE <menu:POPUP,MENU> <oMenu> ;
  68.              [ AT <nRow>, <nCol> ] ;
  69.              [ <of: OF, WINDOW, DIALOG> <oWnd> ] ;
  70.        => ;
  71.           <oMenu>:Activate( <nRow>, <nCol>, <oWnd> )
  72.  
  73. //----------------------------------------------------------------------------//
  74. // Using Window System Menu
  75.  
  76. #xcommand REDEFINE SYSMENU <oMenu> ;
  77.              [ <of: OF, WINDOW, DIALOG> <oWnd> ] ;
  78.        => ;
  79.           <oMenu> := MenuBegin( .f., .t., <oWnd> )
  80.  
  81. #xcommand ENDSYSMENU => MenuEnd()
  82.  
  83. #endif
  84.