From: <kr_...@us...> - 2003-03-26 12:59:28
|
Update of /cvsroot/htoolkit/port/src/cbits/Win32 In directory sc8-pr-cvs1:/tmp/cvs-serv30647/port/src/cbits/Win32 Modified Files: Menu.c Log Message: Additional functions for menu item state Index: Menu.c =================================================================== RCS file: /cvsroot/htoolkit/port/src/cbits/Win32/Menu.c,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Menu.c 30 Jan 2003 23:09:47 -0000 1.3 --- Menu.c 26 Mar 2003 12:59:24 -0000 1.4 *************** *** 124,136 **** } ! void osSetMenuItemSelectState(MenuHandle parent, MenuHandle item, BOOL bState) { EnableMenuItem(parent, (UINT) item, (bState ? MF_ENABLED : MF_GRAYED) | MF_BYCOMMAND); }; ! void osSetCheckMenuItemState(MenuHandle parent, MenuHandle item, BOOL bState) { CheckMenuItem(parent, (UINT) item, (bState ? MF_CHECKED : MF_UNCHECKED) | MF_BYCOMMAND); }; void osSetMenuItemLabel(MenuHandle parent, MenuHandle item, int key, unsigned int mods, char* title) --- 124,154 ---- } ! void osSetMenuItemEnabled(MenuHandle parent, MenuHandle item, BOOL bState) { EnableMenuItem(parent, (UINT) item, (bState ? MF_ENABLED : MF_GRAYED) | MF_BYCOMMAND); }; ! BOOL osGetMenuItemEnabled(MenuHandle parent, MenuHandle item) ! { ! MENUITEMINFO mii; ! mii.cbSize = sizeof(mii); ! mii.fMask = MIIM_STATE; ! GetMenuItemInfo(parent, item, FALSE, &mii); ! return (mii.fState & MFS_ENABLED) != 0; ! }; ! ! void osSetMenuItemChecked(MenuHandle parent, MenuHandle item, BOOL bState) { CheckMenuItem(parent, (UINT) item, (bState ? MF_CHECKED : MF_UNCHECKED) | MF_BYCOMMAND); }; + + BOOL osGetMenuItemChecked(MenuHandle parent, MenuHandle item) + { + MENUITEMINFO mii; + mii.cbSize = sizeof(mii); + mii.fMask = MIIM_STATE; + GetMenuItemInfo(parent, item, FALSE, &mii); + return (mii.fState & MFS_CHECKED) != 0; + } void osSetMenuItemLabel(MenuHandle parent, MenuHandle item, int key, unsigned int mods, char* title) |