home *** CD-ROM | disk | FTP | other *** search
- /**************************************************************/
- /* Menu Test Program for IAccelerator */
- /* IMenu */
- /* IActionBarMenu */
- /* IPopUpMenu */
- /* ISystemMenu */
- /* IMenuItem */
- /* ITitle */
- /* IWindowIcon */
- /* */
- /* CHANGE ACTIVITY: */
- /* DATE: INITIAL: DESCRIPTION */
- /* */
- /* 071882 Peter Hoa Initial code */
- /**************************************************************/
- #include <os2.h>
- #include "tmenu.h"
-
- /*********************************/
- /* icon for application window */
- /*********************************/
-
- ICON ID_ICON1 DOCMT.ICO
- ICON ID_ICON2 HRGLASS.ICO
- ICON ID_ICON3 INBASKET.ICO
- ICON ID_ICON4 FOLDER.ICO
-
- /*****************************/
- /* bitmap icon */
- /*****************************/
- BITMAP ID_BITMAP1 TBDOC.BMP
- BITMAP ID_BITMAP2 PAYNOTE.BMP
- BITMAP ID_BITMAP3 TEMPLATE.BMP
- BITMAP ID_BITMAP4 TINBAS.BMP
- BITMAP ID_BITMAP5 TCSBFORM.BMP
-
- /*****************************/
- /* strings for */
- /* title object text */
- /* title view text */
- /* title view number */
- /* menu text */
- /* */
- /*****************************/
- STRINGTABLE PRELOAD
- BEGIN
- PSZ_TITLE_OBJ1, "IBMCLASS"
- PSZ_TITLE_OBJ2, "Object 2"
- PSZ_TITLE_VIEW1, "Icon, Title, Accelerator, Action Bar/PopUp/System Menu"
- PSZ_TITLE_VIEW2, "View 2"
- PSZ_MENU_TEXT1, "Text Menu Added"
- PSZ_MENU_TEXT2, "Pulldown Add"
- PSZ_MENU_TEXT3, "Action Bar Add"
- PSZ_MENU_TEXT4, "System Menu Add"
- END
-
- /*****************************/
- /* Accelerator Table */
- /*****************************/
- ACCELTABLE ID_ALT_SYS_ACCEL1
- BEGIN
- VK_F5, SC_RESTORE, VIRTUALKEY, SHIFT, SYSCOMMAND
- VK_F7, SC_MOVE, VIRTUALKEY, SHIFT, SYSCOMMAND
- VK_F8, SC_SIZE, VIRTUALKEY, SHIFT, SYSCOMMAND
- VK_F9, SC_MINIMIZE, VIRTUALKEY, SHIFT, SYSCOMMAND
- VK_F10, SC_MAXIMIZE, VIRTUALKEY, SHIFT, SYSCOMMAND
- VK_F4, SC_CLOSE, VIRTUALKEY, SHIFT, SYSCOMMAND
- END
-
-
- ACCELTABLE ID_ALT_SYS_ACCEL2
- BEGIN
- VK_F5, SC_RESTORE, VIRTUALKEY, CONTROL, SHIFT, SYSCOMMAND
- VK_F7, SC_MOVE, VIRTUALKEY, CONTROL, SHIFT, SYSCOMMAND
- VK_F8, SC_SIZE, VIRTUALKEY, CONTROL, SHIFT, SYSCOMMAND
- VK_F9, SC_MINIMIZE, VIRTUALKEY, CONTROL, SHIFT, SYSCOMMAND
- VK_F10, SC_MAXIMIZE, VIRTUALKEY, CONTROL, SHIFT, SYSCOMMAND
- VK_F4, SC_CLOSE, VIRTUALKEY, CONTROL, SHIFT, SYSCOMMAND
- END
-
- ACCELTABLE ID_MENU_WITH_ACCEL
- BEGIN
- VK_F5, ID_TITLE_TEXT, VIRTUALKEY
- END
-
- ACCELTABLE ID_MENU_WITH_ACCEL_CTL
- BEGIN
- VK_F5, ID_TITLE_TEXT, VIRTUALKEY, CONTROL
- END
-
- ACCELTABLE ID_MENU_WITH_ACCEL_CTL_ALT
- BEGIN
- VK_F5, ID_TITLE_TEXT, VIRTUALKEY, CONTROL, ALT
- END
-
- /*****************************/
- /* PopUp Menu */
- /*****************************/
- MENU ID_POPUP
- {
- MENUITEM "Get full title", ID_TITLE_TEXT
- }
-
-
- /*****************************/
- /* PopUp Menu FOR IEntryField*/
- /*****************************/
- MENU ID_EF_POPUP
- {
- MENUITEM "Left justify", ID_LEFT_JUST
- MENUITEM "Center", ID_CENTER
- MENUITEM "Right justify", ID_RIGHT_JUST
- }
-
- /*****************************/
- /* Action Bar Menu */
- /*****************************/
- MENU ID_MENU
- {
- SUBMENU "WindowIcon", ID_WINDOW_ICON
- {
- MENUITEM "setIcon (type 1) to HR_GLASS", ID_WIN_ICON_HR
- MENUITEM "restore to INBASKET", ID_WIN_ICON_IN
- MENUITEM "setIcon (type 2) to DOCMT", ID_WIN_ICON_DOCMT
- MENUITEM "construct new Folder Icon", ID_WIN_ICON_FOLDER
- MENUITEM SEPARATOR
- }
-
- SUBMENU "Title", ID_TITLE
- {
- MENUITEM "objectText", ID_TITLE_OBJ
- MENUITEM "viewText", ID_TITLE_VIEW
- MENUITEM "viewNum", ID_TITLE_VIEW_NUM
- MENUITEM "titleText\tCtl+F5", ID_TITLE_TEXT
- MENUITEM SEPARATOR
- MENUITEM "setObjectText Type 2", ID_TITLE_SET_OBJ2
- MENUITEM "setObjectText Type 1", ID_TITLE_SET_OBJ1
- MENUITEM SEPARATOR
- MENUITEM "setViewText Type 2", ID_TITLE_SET_VIEW2
- MENUITEM "setViewText Type 1", ID_TITLE_SET_VIEW1
- MENUITEM SEPARATOR
- MENUITEM "setViewNum to 2", ID_TITLE_SET_VIEW_NUM2
- MENUITEM "setViewNum to 1", ID_TITLE_SET_VIEW_NUM1
- MENUITEM SEPARATOR
- MENUITEM "setTitleText Type 2", ID_TITLE_SET_TITLE2
- MENUITEM "setTitleText Type 1", ID_TITLE_SET_TITLE1
- MENUITEM SEPARATOR
- MENUITEM "construct another title", ID_TITLE_CONSTRUCT
- MENUITEM SEPARATOR
- }
-
- SUBMENU "Accel", ID_ACCELERATOR
- {
- MENUITEM "setSysAccel to default", ID_ACCEL_SET_SYS1
- MENUITEM "setSysAccel to SHFT+VK", ID_ACCEL_SET_SYS2
- MENUITEM "construct SysAccel w CTL+SFT+VK",ID_ACCEL_SET_SYS3
- MENUITEM "unsetSystemAccel", ID_ACCEL_UNSET_SYS
- MENUITEM SEPARATOR
- MENUITEM "restore Title Accel to CTL+F5", ID_ACCEL_SET1
- MENUITEM "set Title Accel to F5", ID_ACCEL_SET2
- MENUITEM "construct Title Accel to CTL+ALT+F5",ID_ACCEL_SET3
- MENUITEM "unsetAccel", ID_ACCEL_UNSET
- MENUITEM "removeAccel", ID_ACCEL_REMOVE
- MENUITEM "isAccelSet", ID_ACCEL_IS_SET
- MENUITEM SEPARATOR
- }
-
- SUBMENU "ActBarMenu", ID_ACTION_MENU
- {
- MENUITEM "addItem to ActionBar pulldown", ID_ACTION_ADD_ITEM_STRING1
- MENUITEM "addItem to WindowIcon pulldown", ID_ACTION_ADD_ITEM_STRING2
- MENUITEM "addItem to Title pulldown", ID_ACTION_ADD_ITEM_STRING3
- MENUITEM "addItem to Accelerator pulldown",ID_ACTION_ADD_ITEM_STRING4
- MENUITEM SEPARATOR
- MENUITEM "addItem to ActionBar", ID_ACTION_ADD_ITEM_STRING5
- MENUITEM "addItem bitmap to pulldown", ID_ACTION_ADD_ITEM_BITMAP
- MENUITEM "addSeparator to pulldown", ID_ACTION_ADD_SEP
- MENUITEM "deleteItem", ID_ACTION_DELETE
- MENUITEM SEPARATOR
- MENUITEM "isItemChecked(text)", ID_ACTION_IS_CHECKED
- MENUITEM "checkItem", ID_ACTION_CHECK
- MENUITEM "uncheckItem", ID_ACTION_UNCHECK
- MENUITEM SEPARATOR
- MENUITEM "isItemDisabled", ID_ACTION_IS_DISABLED
- MENUITEM "enableItem", ID_ACTION_ENABLE
- MENUITEM "disableItem", ID_ACTION_DISABLE
- }
-
- SUBMENU "PopUpMenu", ID_POPUP_PULLDOWN
- {
- MENUITEM "show(IPoint&)", ID_POPUP_SHOW2
- MENUITEM SEPARATOR
- MENUITEM "id", ID_POPUP_ID
- MENUITEM SEPARATOR
- MENUITEM "addItem string", ID_POPUP_ADD_ITEM_STRING
- MENUITEM "addItem bitmap", ID_POPUP_ADD_ITEM_BITMAP
- MENUITEM "addSeparator", ID_POPUP_ADD_SEP
- MENUITEM "deleteItem", ID_POPUP_DELETE
- MENUITEM SEPARATOR
- MENUITEM "isItemChecked", ID_POPUP_IS_CHECKED
- MENUITEM "checkItem", ID_POPUP_CHECK
- MENUITEM "uncheckItem", ID_POPUP_UNCHECK
- MENUITEM SEPARATOR
- MENUITEM "isItemDisabled", ID_POPUP_IS_DISABLED
- MENUITEM "enableItem", ID_POPUP_ENABLE
- MENUITEM "disableItem", ID_POPUP_DISABLE
- }
-
- SUBMENU "SysMenu", ID_SYSTEM_MENU
- {
- MENUITEM "addItem string", ID_SYSTEM_ADD_ITEM_STRING
- MENUITEM "addItem bitmap", ID_SYSTEM_ADD_ITEM_BITMAP
- MENUITEM "addSeparator", ID_SYSTEM_ADD_SEP
- MENUITEM "deleteItem", ID_SYSTEM_DELETE
- MENUITEM SEPARATOR
- MENUITEM "isItemChecked", ID_SYSTEM_IS_CHECKED
- MENUITEM "checkItem", ID_SYSTEM_CHECK
- MENUITEM "uncheckItem", ID_SYSTEM_UNCHECK
- MENUITEM SEPARATOR
- MENUITEM "isItemDisabled", ID_SYSTEM_IS_DISABLED
- MENUITEM "enableItem", ID_SYSTEM_ENABLE
- MENUITEM "disableItem", ID_SYSTEM_DISABLE
- }
- SUBMENU "Switch Menu", ID_SWITCH
- {
- MENUITEM "setMenu to alternate ActBar", ID_ACTION_ALT
- }
- }
-
- /*****************************/
- /* Alternate Action Bar Menu */
- /*****************************/
- MENU ID_MENU2
- {
- SUBMENU "MenuItem-string", ID_ALT_STRING
- {
- MENUITEM "add item to Pulldown", ID_ALT_STRING_PULL_ADD
- MENUITEM "delete item from Pulldown", ID_ALT_STRING_PULL_REMOVE
- MENUITEM "text Pulldown", ID_ALT_STRING_PULL_TEXT
- MENUITEM "setText (Change)to Pulldown", ID_ALT_STRING_PULL_SET_TEXT1
- MENUITEM "setText (Restore)to Pulldown", ID_ALT_STRING_PULL_SET_TEXT2
- MENUITEM "setAttribute (Framed)", ID_ALT_STRING_PULL_FRAME
- MENUITEM "setAttribute (unFramed)", ID_ALT_STRING_PULL_UNFRAME
- MENUITEM "setStyle (MIS_BREAKSEPARATOR)", ID_ALT_STRING_PULL_STYLE1
- MENUITEM "setStyle (restore default)", ID_ALT_STRING_PULL_STYLE2
- MENUITEM SEPARATOR
- MENUITEM "add item to ActionBar", ID_ALT_STRING_AB_ADD
- MENUITEM "delete item from ActionBar", ID_ALT_STRING_AB_REMOVE
- MENUITEM "text ActionBar", ID_ALT_STRING_AB_TEXT
- MENUITEM "setText (Change)to ActionBar", ID_ALT_STRING_AB_SET_TEXT1
- MENUITEM "setText (Restore)to ActionBar", ID_ALT_STRING_AB_SET_TEXT2
- MENUITEM SEPARATOR
- }
-
- SUBMENU "MenuItem-Bitmap", ID_ALT_BITMAP
- {
- MENUITEM "add bitmap to Pulldown", ID_ALT_BITMAP_ADD_PULLDOWN
- MENUITEM "delete bitmap from Pulldown", ID_ALT_BITMAP_REMOVE_PULLDOWN
- MENUITEM "setBitMap #1", ID_ALT_BITMAP_PULL_SETBITMAP1
- MENUITEM "setBitMap #2", ID_ALT_BITMAP_PULL_SETBITMAP2
- MENUITEM "setAttribute (Framed)", ID_ALT_BITMAP_SET_ATTRIB1
- MENUITEM "setAttribute (unFramed)", ID_ALT_BITMAP_SET_ATTRIB2
- MENUITEM "setStyle (MIS_BREAKSEPARATOR)", ID_ALT_BITMAP_SET_STYLE1
- MENUITEM "setStyle (default)", ID_ALT_BITMAP_SET_STYLE2
- MENUITEM SEPARATOR
- MENUITEM "add bitmap to ActionBar", ID_ALT_BITMAP_ADD_ACTION
- MENUITEM "delete bitmap from ActionBar", ID_ALT_BITMAP_REMOVE_ACTION
- MENUITEM SEPARATOR
- }
- SUBMENU "Switch Menu", ID_ALT_SWITCH
- {
- MENUITEM "setMenu to Default ActBarMenu", ID_ALT_ACTION_SET_DEF
- }
- }