home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Professional Developers Kit 1992 November / Disc01 / Disc01.mdf / cppbeta / clsam2j / tmenu.rc_ / TMENU.RC
Encoding:
Text File  |  1992-10-09  |  11.7 KB  |  275 lines

  1. /**************************************************************/
  2. /* Menu Test Program for IAccelerator                         */
  3. /*                       IMenu                                */
  4. /*                       IActionBarMenu                       */
  5. /*                       IPopUpMenu                           */
  6. /*                       ISystemMenu                          */
  7. /*                       IMenuItem                            */
  8. /*                       ITitle                               */
  9. /*                       IWindowIcon                          */
  10. /*                                                            */
  11. /* CHANGE ACTIVITY:                                           */
  12. /*   DATE:     INITIAL:        DESCRIPTION                    */
  13. /*                                                            */
  14. /*   071882    Peter Hoa       Initial  code                  */
  15. /**************************************************************/
  16. #include <os2.h> 
  17. #include "tmenu.h"
  18.  
  19. /*********************************/
  20. /* icon for application window   */
  21. /*********************************/
  22.  
  23. ICON    ID_ICON1        DOCMT.ICO
  24. ICON    ID_ICON2        HRGLASS.ICO
  25. ICON    ID_ICON3        INBASKET.ICO
  26. ICON    ID_ICON4        FOLDER.ICO
  27.  
  28. /*****************************/
  29. /* bitmap icon               */
  30. /*****************************/
  31. BITMAP  ID_BITMAP1      TBDOC.BMP
  32. BITMAP  ID_BITMAP2      PAYNOTE.BMP
  33. BITMAP  ID_BITMAP3      TEMPLATE.BMP
  34. BITMAP  ID_BITMAP4      TINBAS.BMP
  35. BITMAP  ID_BITMAP5      TCSBFORM.BMP
  36.  
  37. /*****************************/
  38. /* strings for               */
  39. /*     title object text     */
  40. /*     title view text       */
  41. /*     title view number     */
  42. /*     menu text             */
  43. /*                           */
  44. /*****************************/
  45. STRINGTABLE PRELOAD
  46. BEGIN
  47.   PSZ_TITLE_OBJ1,                   "IBMCLASS"
  48.   PSZ_TITLE_OBJ2,                   "Object 2"
  49.   PSZ_TITLE_VIEW1,                  "Icon, Title, Accelerator, Action Bar/PopUp/System Menu" 
  50.   PSZ_TITLE_VIEW2,                  "View 2"
  51.   PSZ_MENU_TEXT1,                   "Text Menu Added"
  52.   PSZ_MENU_TEXT2,                   "Pulldown Add"
  53.   PSZ_MENU_TEXT3,                   "Action Bar Add"
  54.   PSZ_MENU_TEXT4,                   "System Menu Add"
  55. END
  56.  
  57. /*****************************/
  58. /* Accelerator Table         */
  59. /*****************************/
  60. ACCELTABLE ID_ALT_SYS_ACCEL1
  61. BEGIN
  62.         VK_F5,  SC_RESTORE,     VIRTUALKEY,     SHIFT,  SYSCOMMAND
  63.         VK_F7,  SC_MOVE,        VIRTUALKEY,     SHIFT,  SYSCOMMAND
  64.         VK_F8,  SC_SIZE,        VIRTUALKEY,     SHIFT,  SYSCOMMAND
  65.         VK_F9,  SC_MINIMIZE,    VIRTUALKEY,     SHIFT,  SYSCOMMAND
  66.         VK_F10, SC_MAXIMIZE,    VIRTUALKEY,     SHIFT,  SYSCOMMAND
  67.         VK_F4,  SC_CLOSE,       VIRTUALKEY,     SHIFT,  SYSCOMMAND
  68. END
  69.  
  70.  
  71. ACCELTABLE ID_ALT_SYS_ACCEL2
  72. BEGIN
  73.         VK_F5,  SC_RESTORE,     VIRTUALKEY,     CONTROL, SHIFT,  SYSCOMMAND
  74.         VK_F7,  SC_MOVE,        VIRTUALKEY,     CONTROL, SHIFT,  SYSCOMMAND
  75.         VK_F8,  SC_SIZE,        VIRTUALKEY,     CONTROL, SHIFT,  SYSCOMMAND
  76.         VK_F9,  SC_MINIMIZE,    VIRTUALKEY,     CONTROL, SHIFT,  SYSCOMMAND
  77.         VK_F10, SC_MAXIMIZE,    VIRTUALKEY,     CONTROL, SHIFT,  SYSCOMMAND
  78.         VK_F4,  SC_CLOSE,       VIRTUALKEY,     CONTROL, SHIFT,  SYSCOMMAND
  79. END
  80.  
  81. ACCELTABLE ID_MENU_WITH_ACCEL
  82. BEGIN
  83.         VK_F5, ID_TITLE_TEXT,          VIRTUALKEY
  84. END
  85.  
  86. ACCELTABLE ID_MENU_WITH_ACCEL_CTL
  87. BEGIN
  88.         VK_F5, ID_TITLE_TEXT,          VIRTUALKEY, CONTROL
  89. END
  90.  
  91. ACCELTABLE ID_MENU_WITH_ACCEL_CTL_ALT
  92. BEGIN
  93.         VK_F5, ID_TITLE_TEXT,          VIRTUALKEY, CONTROL, ALT
  94. END
  95.  
  96. /*****************************/
  97. /* PopUp Menu                */
  98. /*****************************/
  99. MENU ID_POPUP
  100. {
  101.      MENUITEM "Get full title",                 ID_TITLE_TEXT
  102. }
  103.  
  104.  
  105. /*****************************/
  106. /* PopUp Menu FOR IEntryField*/
  107. /*****************************/
  108. MENU ID_EF_POPUP
  109. {
  110.      MENUITEM "Left justify",                 ID_LEFT_JUST
  111.      MENUITEM "Center",                       ID_CENTER
  112.      MENUITEM "Right justify",                ID_RIGHT_JUST
  113. }
  114.  
  115. /*****************************/
  116. /* Action Bar Menu           */
  117. /*****************************/
  118. MENU ID_MENU
  119. {
  120.   SUBMENU "WindowIcon",                         ID_WINDOW_ICON
  121.    {
  122.      MENUITEM "setIcon (type 1) to HR_GLASS",   ID_WIN_ICON_HR
  123.      MENUITEM "restore to INBASKET",            ID_WIN_ICON_IN
  124.      MENUITEM "setIcon (type 2) to DOCMT",      ID_WIN_ICON_DOCMT
  125.      MENUITEM "construct new Folder Icon",      ID_WIN_ICON_FOLDER
  126.      MENUITEM SEPARATOR
  127.    }
  128.  
  129.   SUBMENU "Title",                              ID_TITLE
  130.    {
  131.      MENUITEM "objectText",                     ID_TITLE_OBJ
  132.      MENUITEM "viewText",                       ID_TITLE_VIEW
  133.      MENUITEM "viewNum",                        ID_TITLE_VIEW_NUM
  134.      MENUITEM "titleText\tCtl+F5",             ID_TITLE_TEXT
  135.      MENUITEM SEPARATOR
  136.      MENUITEM "setObjectText Type 2",           ID_TITLE_SET_OBJ2
  137.      MENUITEM "setObjectText Type 1",           ID_TITLE_SET_OBJ1
  138.      MENUITEM SEPARATOR
  139.      MENUITEM "setViewText Type 2",             ID_TITLE_SET_VIEW2
  140.      MENUITEM "setViewText Type 1",             ID_TITLE_SET_VIEW1
  141.      MENUITEM SEPARATOR
  142.      MENUITEM "setViewNum to 2",                ID_TITLE_SET_VIEW_NUM2
  143.      MENUITEM "setViewNum to 1",                ID_TITLE_SET_VIEW_NUM1
  144.      MENUITEM SEPARATOR
  145.      MENUITEM "setTitleText Type 2",            ID_TITLE_SET_TITLE2
  146.      MENUITEM "setTitleText Type 1",            ID_TITLE_SET_TITLE1
  147.      MENUITEM SEPARATOR
  148.      MENUITEM "construct another title",        ID_TITLE_CONSTRUCT
  149.      MENUITEM SEPARATOR
  150.    }
  151.  
  152.   SUBMENU "Accel",                              ID_ACCELERATOR
  153.    {
  154.      MENUITEM "setSysAccel to default",         ID_ACCEL_SET_SYS1
  155.      MENUITEM "setSysAccel to SHFT+VK",         ID_ACCEL_SET_SYS2
  156.      MENUITEM "construct SysAccel w CTL+SFT+VK",ID_ACCEL_SET_SYS3
  157.      MENUITEM "unsetSystemAccel",               ID_ACCEL_UNSET_SYS
  158.      MENUITEM SEPARATOR
  159.      MENUITEM "restore Title Accel to CTL+F5", ID_ACCEL_SET1
  160.      MENUITEM "set Title Accel to F5",         ID_ACCEL_SET2
  161.      MENUITEM "construct Title Accel to CTL+ALT+F5",ID_ACCEL_SET3
  162.      MENUITEM "unsetAccel",                     ID_ACCEL_UNSET
  163.      MENUITEM "removeAccel",                    ID_ACCEL_REMOVE
  164.      MENUITEM "isAccelSet",                     ID_ACCEL_IS_SET
  165.      MENUITEM SEPARATOR
  166.    }
  167.  
  168.   SUBMENU "ActBarMenu",                         ID_ACTION_MENU
  169.    {
  170.      MENUITEM "addItem to ActionBar pulldown",  ID_ACTION_ADD_ITEM_STRING1
  171.      MENUITEM "addItem to WindowIcon pulldown", ID_ACTION_ADD_ITEM_STRING2
  172.      MENUITEM "addItem to Title pulldown",      ID_ACTION_ADD_ITEM_STRING3
  173.      MENUITEM "addItem to Accelerator pulldown",ID_ACTION_ADD_ITEM_STRING4
  174.      MENUITEM SEPARATOR
  175.      MENUITEM "addItem to ActionBar",           ID_ACTION_ADD_ITEM_STRING5
  176.      MENUITEM "addItem bitmap to pulldown",     ID_ACTION_ADD_ITEM_BITMAP
  177.      MENUITEM "addSeparator to pulldown",       ID_ACTION_ADD_SEP
  178.      MENUITEM "deleteItem",                     ID_ACTION_DELETE
  179.      MENUITEM SEPARATOR
  180.      MENUITEM "isItemChecked(text)",            ID_ACTION_IS_CHECKED
  181.      MENUITEM "checkItem",                      ID_ACTION_CHECK
  182.      MENUITEM "uncheckItem",                    ID_ACTION_UNCHECK
  183.      MENUITEM SEPARATOR
  184.      MENUITEM "isItemDisabled",                 ID_ACTION_IS_DISABLED
  185.      MENUITEM "enableItem",                     ID_ACTION_ENABLE
  186.      MENUITEM "disableItem",                    ID_ACTION_DISABLE
  187.    }
  188.  
  189.   SUBMENU "PopUpMenu",                          ID_POPUP_PULLDOWN
  190.    {
  191.      MENUITEM "show(IPoint&)",                  ID_POPUP_SHOW2
  192.      MENUITEM SEPARATOR
  193.      MENUITEM "id",                             ID_POPUP_ID
  194.      MENUITEM SEPARATOR
  195.      MENUITEM "addItem string",                 ID_POPUP_ADD_ITEM_STRING
  196.      MENUITEM "addItem bitmap",                 ID_POPUP_ADD_ITEM_BITMAP
  197.      MENUITEM "addSeparator",                   ID_POPUP_ADD_SEP
  198.      MENUITEM "deleteItem",                     ID_POPUP_DELETE
  199.      MENUITEM SEPARATOR
  200.      MENUITEM "isItemChecked",                  ID_POPUP_IS_CHECKED
  201.      MENUITEM "checkItem",                      ID_POPUP_CHECK
  202.      MENUITEM "uncheckItem",                    ID_POPUP_UNCHECK
  203.      MENUITEM SEPARATOR
  204.      MENUITEM "isItemDisabled",                 ID_POPUP_IS_DISABLED
  205.      MENUITEM "enableItem",                     ID_POPUP_ENABLE
  206.      MENUITEM "disableItem",                    ID_POPUP_DISABLE
  207.    }
  208.  
  209.   SUBMENU "SysMenu",                            ID_SYSTEM_MENU
  210.    {
  211.      MENUITEM "addItem string",                 ID_SYSTEM_ADD_ITEM_STRING
  212.      MENUITEM "addItem bitmap",                 ID_SYSTEM_ADD_ITEM_BITMAP
  213.      MENUITEM "addSeparator",                   ID_SYSTEM_ADD_SEP
  214.      MENUITEM "deleteItem",                     ID_SYSTEM_DELETE
  215.      MENUITEM SEPARATOR
  216.      MENUITEM "isItemChecked",                  ID_SYSTEM_IS_CHECKED
  217.      MENUITEM "checkItem",                      ID_SYSTEM_CHECK
  218.      MENUITEM "uncheckItem",                    ID_SYSTEM_UNCHECK
  219.      MENUITEM SEPARATOR
  220.      MENUITEM "isItemDisabled",                 ID_SYSTEM_IS_DISABLED
  221.      MENUITEM "enableItem",                     ID_SYSTEM_ENABLE
  222.      MENUITEM "disableItem",                    ID_SYSTEM_DISABLE
  223.    }
  224.   SUBMENU "Switch Menu",                        ID_SWITCH
  225.    {
  226.      MENUITEM "setMenu to alternate ActBar",    ID_ACTION_ALT
  227.    }
  228. }
  229.  
  230. /*****************************/
  231. /* Alternate Action Bar Menu */
  232. /*****************************/
  233. MENU ID_MENU2
  234. {
  235.   SUBMENU "MenuItem-string",                ID_ALT_STRING
  236.    {
  237.      MENUITEM "add item to Pulldown",           ID_ALT_STRING_PULL_ADD
  238.      MENUITEM "delete item from Pulldown",      ID_ALT_STRING_PULL_REMOVE
  239.      MENUITEM "text Pulldown",                  ID_ALT_STRING_PULL_TEXT
  240.      MENUITEM "setText (Change)to Pulldown",    ID_ALT_STRING_PULL_SET_TEXT1
  241.      MENUITEM "setText (Restore)to Pulldown",   ID_ALT_STRING_PULL_SET_TEXT2
  242.      MENUITEM "setAttribute (Framed)",          ID_ALT_STRING_PULL_FRAME
  243.      MENUITEM "setAttribute (unFramed)",        ID_ALT_STRING_PULL_UNFRAME
  244.      MENUITEM "setStyle (MIS_BREAKSEPARATOR)",  ID_ALT_STRING_PULL_STYLE1
  245.      MENUITEM "setStyle (restore default)",     ID_ALT_STRING_PULL_STYLE2
  246.      MENUITEM SEPARATOR
  247.      MENUITEM "add item to ActionBar",          ID_ALT_STRING_AB_ADD
  248.      MENUITEM "delete item from ActionBar",     ID_ALT_STRING_AB_REMOVE
  249.      MENUITEM "text ActionBar",                 ID_ALT_STRING_AB_TEXT
  250.      MENUITEM "setText (Change)to ActionBar",   ID_ALT_STRING_AB_SET_TEXT1
  251.      MENUITEM "setText (Restore)to ActionBar",  ID_ALT_STRING_AB_SET_TEXT2
  252.      MENUITEM SEPARATOR
  253.    }
  254.  
  255.   SUBMENU "MenuItem-Bitmap",                ID_ALT_BITMAP
  256.    {
  257.      MENUITEM "add bitmap to Pulldown",         ID_ALT_BITMAP_ADD_PULLDOWN
  258.      MENUITEM "delete bitmap from Pulldown",    ID_ALT_BITMAP_REMOVE_PULLDOWN
  259.      MENUITEM "setBitMap #1",                   ID_ALT_BITMAP_PULL_SETBITMAP1
  260.      MENUITEM "setBitMap #2",                   ID_ALT_BITMAP_PULL_SETBITMAP2
  261.      MENUITEM "setAttribute (Framed)",          ID_ALT_BITMAP_SET_ATTRIB1
  262.      MENUITEM "setAttribute (unFramed)",        ID_ALT_BITMAP_SET_ATTRIB2
  263.      MENUITEM "setStyle (MIS_BREAKSEPARATOR)",  ID_ALT_BITMAP_SET_STYLE1
  264.      MENUITEM "setStyle (default)",             ID_ALT_BITMAP_SET_STYLE2
  265.      MENUITEM SEPARATOR
  266.      MENUITEM "add bitmap to ActionBar",        ID_ALT_BITMAP_ADD_ACTION
  267.      MENUITEM "delete bitmap from ActionBar",   ID_ALT_BITMAP_REMOVE_ACTION
  268.      MENUITEM SEPARATOR
  269.    }
  270.   SUBMENU "Switch Menu",                        ID_ALT_SWITCH
  271.    {
  272.      MENUITEM "setMenu to Default ActBarMenu",  ID_ALT_ACTION_SET_DEF
  273.    }
  274. }
  275.