| 1 | #define INCL_WIN
|
|---|
| 2 | #define INCL_GPI
|
|---|
| 3 | #define INCL_DOS
|
|---|
| 4 | #define INCL_DOSERRORS
|
|---|
| 5 |
|
|---|
| 6 | #include <os2.h>
|
|---|
| 7 | #include <sys/types.h>
|
|---|
| 8 | #include <sys/stat.h>
|
|---|
| 9 |
|
|---|
| 10 | #include <stdio.h>
|
|---|
| 11 | #include <string.h>
|
|---|
| 12 | #include <stdarg.h>
|
|---|
| 13 |
|
|---|
| 14 | #if __cplusplus
|
|---|
| 15 | extern "C" {
|
|---|
| 16 | #endif
|
|---|
| 17 |
|
|---|
| 18 |
|
|---|
| 19 | /*!**************************************************/
|
|---|
| 20 | /* */
|
|---|
| 21 | /* @@DESC */
|
|---|
| 22 | /* */
|
|---|
| 23 | /* This funktion inserts a separator into menu */
|
|---|
| 24 | /* <hwndMenu> and submenu <hwndSubMenu> at */
|
|---|
| 25 | /* position <iPosition>. */
|
|---|
| 26 | /* */
|
|---|
| 27 | /* */
|
|---|
| 28 | /* */
|
|---|
| 29 | /* */
|
|---|
| 30 | /* */
|
|---|
| 31 | /*!!*************************************************/
|
|---|
| 32 | MRESULT menuInsertMenuSeparator(HWND hwndMenu, HWND hwndSubMenu, SHORT sPosition )
|
|---|
| 33 | {
|
|---|
| 34 | MENUITEM mi={0};
|
|---|
| 35 |
|
|---|
| 36 | /* Fill the MENUITEM structure */
|
|---|
| 37 | mi.iPosition=sPosition;
|
|---|
| 38 | mi.afStyle=MIS_SEPARATOR;
|
|---|
| 39 | if(hwndSubMenu)
|
|---|
| 40 | mi.afStyle|=MIS_SUBMENU;
|
|---|
| 41 | mi.id=0;
|
|---|
| 42 | mi.afAttribute=NULLHANDLE;
|
|---|
| 43 | mi.hwndSubMenu=hwndSubMenu;
|
|---|
| 44 | mi.hItem=NULLHANDLE;
|
|---|
| 45 |
|
|---|
| 46 | return WinSendMsg(hwndMenu,MM_INSERTITEM,(MPARAM)&mi,
|
|---|
| 47 | (MPARAM)NULL);
|
|---|
| 48 | }
|
|---|
| 49 |
|
|---|
| 50 |
|
|---|
| 51 | /*!**************************************************/
|
|---|
| 52 | /* */
|
|---|
| 53 | /* @@DESC */
|
|---|
| 54 | /* */
|
|---|
| 55 | /* This funktion inserts an item into menu */
|
|---|
| 56 | /* <hwndMenu> and submenu <hwndSubMenu> at */
|
|---|
| 57 | /* position <iPosition>. */
|
|---|
| 58 | /* */
|
|---|
| 59 | /*!!*************************************************/
|
|---|
| 60 | SHORT menuInsertMenuItem( HWND hwndMenu, HWND hwndSubMenu, SHORT sPosition, USHORT iID, char * chrText)
|
|---|
| 61 | {
|
|---|
| 62 | MENUITEM mi={0};
|
|---|
| 63 |
|
|---|
| 64 | /* Fill the MENUITEM structure */
|
|---|
| 65 | mi.iPosition=sPosition;
|
|---|
| 66 | mi.afStyle=MIS_TEXT;
|
|---|
| 67 | if(hwndSubMenu)
|
|---|
| 68 | mi.afStyle|=MIS_SUBMENU;
|
|---|
| 69 | mi.id=iID;
|
|---|
| 70 | mi.afAttribute=NULLHANDLE;
|
|---|
| 71 | mi.hwndSubMenu=hwndSubMenu;
|
|---|
| 72 | mi.hItem=NULLHANDLE;
|
|---|
| 73 |
|
|---|
| 74 | return SHORT1FROMMR(WinSendMsg(hwndMenu,MM_INSERTITEM,(MPARAM)&mi,
|
|---|
| 75 | (MPARAM)chrText));
|
|---|
| 76 | }
|
|---|
| 77 |
|
|---|
| 78 | /*!***********************************************************/
|
|---|
| 79 | /* */
|
|---|
| 80 | /* @@DESC */
|
|---|
| 81 | /* */
|
|---|
| 82 | /* To be written... */
|
|---|
| 83 | /* */
|
|---|
| 84 | /*!!**********************************************************/
|
|---|
| 85 | SHORT menuQueryItemCount(HWND hwndMenu)
|
|---|
| 86 | {
|
|---|
| 87 | return SHORT1FROMMR(WinSendMsg( hwndMenu, MM_QUERYITEMCOUNT, MPFROMLONG(0L),
|
|---|
| 88 | MPFROMLONG(0L)));
|
|---|
| 89 | }
|
|---|
| 90 |
|
|---|
| 91 | /*!***********************************************************/
|
|---|
| 92 | /* */
|
|---|
| 93 | /* @@DESC */
|
|---|
| 94 | /* */
|
|---|
| 95 | /* To be written... */
|
|---|
| 96 | /* */
|
|---|
| 97 | /*!!**********************************************************/
|
|---|
| 98 | MRESULT menuCheckItem(HWND hwndMenu, USHORT usID, BOOL fIncludeSubMenu, BOOL fCheck)
|
|---|
| 99 | {
|
|---|
| 100 | return WinSendMsg( hwndMenu, MM_SETITEMATTR, MPFROM2SHORT(usID, fIncludeSubMenu),
|
|---|
| 101 | MPFROM2SHORT(MIA_CHECKED, (fCheck ? MIA_CHECKED : FALSE)));
|
|---|
| 102 | }
|
|---|
| 103 |
|
|---|
| 104 | /*!***********************************************************/
|
|---|
| 105 | /* */
|
|---|
| 106 | /* @@DESC */
|
|---|
| 107 | /* */
|
|---|
| 108 | /* To be written... */
|
|---|
| 109 | /* */
|
|---|
| 110 | /*!!**********************************************************/
|
|---|
| 111 | MRESULT menuRemoveItem(HWND hwndMenu, USHORT usID, BOOL fIncludeSubMenu)
|
|---|
| 112 | {
|
|---|
| 113 | return WinSendMsg( hwndMenu, MM_SETITEMATTR, MPFROM2SHORT(usID, fIncludeSubMenu),
|
|---|
| 114 | MPFROMLONG(0L));
|
|---|
| 115 | }
|
|---|
| 116 |
|
|---|
| 117 | /*!***********************************************************/
|
|---|
| 118 | /* */
|
|---|
| 119 | /* @@DESC */
|
|---|
| 120 | /* */
|
|---|
| 121 | /* To be written... */
|
|---|
| 122 | /* */
|
|---|
| 123 | /*!!**********************************************************/
|
|---|
| 124 | MRESULT menuCheckForItem(HWND hwndMenu, USHORT usID, BOOL fIncludeSubMenu)
|
|---|
| 125 | {
|
|---|
| 126 | MENUITEM mi;
|
|---|
| 127 | return WinSendMsg( hwndMenu, MM_QUERYITEM, MPFROM2SHORT(usID, fIncludeSubMenu),
|
|---|
| 128 | MPFROMP(&mi));
|
|---|
| 129 | }
|
|---|
| 130 |
|
|---|
| 131 |
|
|---|
| 132 | #if __cplusplus
|
|---|
| 133 | }
|
|---|
| 134 | #endif
|
|---|
| 135 |
|
|---|