- Timestamp:
- Jan 3, 2003, 5:56:03 PM (23 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/user32/menu.c
r9598 r9599 1207 1207 dis.itemState = 0; 1208 1208 if (lpitem->fState & MF_CHECKED) dis.itemState |= ODS_CHECKED; 1209 if (lpitem->fState & MF_GRAYED) dis.itemState |= ODS_GRAYED ;1209 if (lpitem->fState & MF_GRAYED) dis.itemState |= ODS_GRAYED|ODS_DISABLED; 1210 1210 if (lpitem->fState & MF_HILITE) dis.itemState |= ODS_SELECTED; 1211 1211 dis.itemAction = odaction; /* ODA_DRAWENTIRE | ODA_SELECT | ODA_FOCUS; */ … … 1972 1972 res += sizeof(WORD); 1973 1973 } 1974 if (!IS_STRING_ITEM(flags))1975 ERR("not a string item %04x\n", flags );1976 1974 str = res; 1977 1975 if (!unicode) res += strlen(str) + 1; … … 2038 2036 DestroyMenu(mii.hSubMenu); 2039 2037 return NULL; 2040 }2038 } 2041 2039 mii.fMask |= MIIM_SUBMENU; 2042 2040 mii.fType |= MF_POPUP; 2043 2041 } 2042 else if(!*mii.dwTypeData && !(mii.fType & MF_SEPARATOR)) 2043 { 2044 WARN("Converting NULL menu item %04x, type %04x to SEPARATOR\n", 2045 mii.wID, mii.fType); 2046 mii.fType |= MF_SEPARATOR; 2047 } 2044 2048 InsertMenuItemW(hMenu, -1, MF_BYPOSITION, &mii); 2045 2049 } while (!(resinfo & MF_END)); … … 2823 2827 { 2824 2828 /* 2825 * use the mouse coordinates in lParam instead of those in the MSG 2826 * struct to properly handle synthetic messages. lParam coords are 2827 * relative to client area, so they must be converted; since they can 2828 * be negative, we must use SLOWORD/SHIWORD instead of LOWORD/HIWORD. 2829 * Use the mouse coordinates in lParam instead of those in the MSG 2830 * struct to properly handle synthetic messages. They are already 2831 * in screen coordinates. 2829 2832 */ 2830 2833 mt.pt.x = SLOWORD(msg.lParam); 2831 2834 mt.pt.y = SHIWORD(msg.lParam); 2832 ClientToScreen(msg.hwnd,&mt.pt);2833 2835 2834 2836 /* Find a menu for this mouse event */ … … 3333 3335 3334 3336 /******************************************************************* 3335 * ChangeMenu (USER.153)3336 */3337 BOOL16 WINAPI ChangeMenu16( HMENU16 hMenu, UINT16 pos, SEGPTR data,3338 UINT16 id, UINT16 flags )3339 {3340 TRACE("menu=%04x pos=%d data=%08lx id=%04x flags=%04x\n",3341 hMenu, pos, (DWORD)data, id, flags );3342 if (flags & MF_APPEND) return AppendMenu16( hMenu, flags & ~MF_APPEND,3343 id, data );3344 3345 /* FIXME: Word passes the item id in 'pos' and 0 or 0xffff as id */3346 /* for MF_DELETE. We should check the parameters for all others */3347 /* MF_* actions also (anybody got a doc on ChangeMenu?). */3348 3349 if (flags & MF_DELETE) return DeleteMenu16(hMenu, pos, flags & ~MF_DELETE);3350 if (flags & MF_CHANGE) return ModifyMenu16(hMenu, pos, flags & ~MF_CHANGE,3351 id, data );3352 if (flags & MF_REMOVE) return RemoveMenu16(hMenu,3353 flags & MF_BYPOSITION ? pos : id,3354 flags & ~MF_REMOVE );3355 /* Default: MF_INSERT */3356 return InsertMenu16( hMenu, pos, flags, id, data );3357 }3358 3359 3360 /*******************************************************************3361 3337 * ChangeMenuA (USER32.@) 3362 3338 */ … … 3401 3377 3402 3378 /******************************************************************* 3403 * CheckMenuItem (USER.154)3404 */3405 BOOL16 WINAPI CheckMenuItem16( HMENU16 hMenu, UINT16 id, UINT16 flags )3406 {3407 return (BOOL16)CheckMenuItem( hMenu, id, flags );3408 }3409 3410 3411 /*******************************************************************3412 3379 * CheckMenuItem (USER32.@) 3413 3380 */ … … 3423 3390 else item->fState &= ~MF_CHECKED; 3424 3391 return ret; 3425 }3426 3427 3428 /**********************************************************************3429 * EnableMenuItem (USER.155)3430 */3431 UINT16 WINAPI EnableMenuItem16( HMENU16 hMenu, UINT16 wItemID, UINT16 wFlags )3432 {3433 return EnableMenuItem( hMenu, wItemID, wFlags );3434 3392 } 3435 3393 … … 3476 3434 3477 3435 return oldflags; 3478 }3479 3480 3481 /*******************************************************************3482 * GetMenuString (USER.161)3483 */3484 INT16 WINAPI GetMenuString16( HMENU16 hMenu, UINT16 wItemID,3485 LPSTR str, INT16 nMaxSiz, UINT16 wFlags )3486 {3487 return GetMenuStringA( hMenu, wItemID, str, nMaxSiz, wFlags );3488 3436 } 3489 3437 … … 3552 3500 3553 3501 /********************************************************************** 3554 * GetMenuState (USER.250)3555 */3556 UINT16 WINAPI GetMenuState16( HMENU16 hMenu, UINT16 wItemID, UINT16 wFlags )3557 {3558 return GetMenuState( hMenu, wItemID, wFlags );3559 }3560 3561 3562 /**********************************************************************3563 3502 * GetMenuState (USER32.@) 3564 3503 */ … … 3587 3526 3588 3527 /********************************************************************** 3589 * GetMenuItemCount (USER .263)3590 */ 3591 INT 16 WINAPI GetMenuItemCount16( HMENU16hMenu )3528 * GetMenuItemCount (USER32.@) 3529 */ 3530 INT WINAPI GetMenuItemCount( HMENU hMenu ) 3592 3531 { 3593 3532 LPPOPUPMENU menu = MENU_GetMenu(hMenu); … … 3598 3537 } 3599 3538 3600 3601 /**********************************************************************3602 * GetMenuItemCount (USER32.@)3603 */3604 INT WINAPI GetMenuItemCount( HMENU hMenu )3605 {3606 LPPOPUPMENU menu = MENU_GetMenu(hMenu);3607 if (!menu) return -1;3608 TRACE("(%04x) returning %d\n",3609 hMenu, menu->nItems );3610 return menu->nItems;3611 }3612 3613 3539 /********************************************************************** 3614 3540 * GetMenuItemID (USER.264) … … 3630 3556 return lpmi->wID; 3631 3557 3632 }3633 3634 /*******************************************************************3635 * InsertMenu (USER.410)3636 */3637 BOOL16 WINAPI InsertMenu16( HMENU16 hMenu, UINT16 pos, UINT16 flags,3638 UINT16 id, SEGPTR data )3639 {3640 UINT pos32 = (UINT)pos;3641 if ((pos == (UINT16)-1) && (flags & MF_BYPOSITION)) pos32 = (UINT)-1;3642 if (IS_STRING_ITEM(flags) && data)3643 return InsertMenuA( hMenu, pos32, flags, id, MapSL(data) );3644 return InsertMenuA( hMenu, pos32, flags, id, (LPSTR)data );3645 3558 } 3646 3559 … … 3703 3616 3704 3617 /******************************************************************* 3705 * AppendMenu (USER.411)3706 */3707 BOOL16 WINAPI AppendMenu16(HMENU16 hMenu, UINT16 flags, UINT16 id, SEGPTR data)3708 {3709 return InsertMenu16( hMenu, -1, flags | MF_BYPOSITION, id, data );3710 }3711 3712 3713 /*******************************************************************3714 3618 * AppendMenuA (USER32.@) 3715 3619 */ … … 3728 3632 { 3729 3633 return InsertMenuW( hMenu, -1, flags | MF_BYPOSITION, id, data ); 3730 }3731 3732 3733 /**********************************************************************3734 * RemoveMenu (USER.412)3735 */3736 BOOL16 WINAPI RemoveMenu16( HMENU16 hMenu, UINT16 nPos, UINT16 wFlags )3737 {3738 return RemoveMenu( hMenu, nPos, wFlags );3739 3634 } 3740 3635 … … 3773 3668 } 3774 3669 return TRUE; 3775 }3776 3777 3778 /**********************************************************************3779 * DeleteMenu (USER.413)3780 */3781 BOOL16 WINAPI DeleteMenu16( HMENU16 hMenu, UINT16 nPos, UINT16 wFlags )3782 {3783 return DeleteMenu( hMenu, nPos, wFlags );3784 3670 } 3785 3671 … … 3796 3682 RemoveMenu( hMenu, nPos, wFlags | MF_BYPOSITION ); 3797 3683 return TRUE; 3798 }3799 3800 3801 /*******************************************************************3802 * ModifyMenu (USER.414)3803 */3804 BOOL16 WINAPI ModifyMenu16( HMENU16 hMenu, UINT16 pos, UINT16 flags,3805 UINT16 id, SEGPTR data )3806 {3807 if (IS_STRING_ITEM(flags))3808 return ModifyMenuA( hMenu, pos, flags, id, MapSL(data) );3809 return ModifyMenuA( hMenu, pos, flags, id, (LPSTR)data );3810 3684 } 3811 3685 … … 3861 3735 3862 3736 /********************************************************************** 3863 * CreatePopupMenu (USER.415)3864 */3865 HMENU16 WINAPI CreatePopupMenu16(void)3866 {3867 return CreatePopupMenu();3868 }3869 3870 3871 /**********************************************************************3872 3737 * CreatePopupMenu (USER32.@) 3873 3738 */ … … 3896 3761 3897 3762 /********************************************************************** 3898 * SetMenuItemBitmaps (USER.418)3899 */3900 BOOL16 WINAPI SetMenuItemBitmaps16( HMENU16 hMenu, UINT16 nPos, UINT16 wFlags,3901 HBITMAP16 hNewUnCheck, HBITMAP16 hNewCheck)3902 {3903 return SetMenuItemBitmaps( hMenu, nPos, wFlags, hNewUnCheck, hNewCheck );3904 }3905 3906 3907 /**********************************************************************3908 3763 * SetMenuItemBitmaps (USER32.@) 3909 3764 */ … … 3927 3782 } 3928 3783 return TRUE; 3929 }3930 3931 3932 /**********************************************************************3933 * CreateMenu (USER.151)3934 */3935 HMENU16 WINAPI CreateMenu16(void)3936 {3937 return CreateMenu();3938 3784 } 3939 3785 … … 3962 3808 3963 3809 return hMenu; 3964 }3965 3966 3967 /**********************************************************************3968 * DestroyMenu (USER.152)3969 */3970 BOOL16 WINAPI DestroyMenu16( HMENU16 hMenu )3971 {3972 return DestroyMenu( hMenu );3973 3810 } 3974 3811 … … 4209 4046 } 4210 4047 4211 4212 4213 /**********************************************************************4214 * GetSubMenu (USER.159)4215 */4216 HMENU16 WINAPI GetSubMenu16( HMENU16 hMenu, INT16 nPos )4217 {4218 return GetSubMenu( hMenu, nPos );4219 }4220 4048 4221 4049 … … 4440 4268 4441 4269 /********************************************************************** 4442 * IsMenu (USER.358)4443 */4444 BOOL16 WINAPI IsMenu16( HMENU16 hmenu )4445 {4446 return IsMenu( hmenu );4447 }4448 4449 4450 /**********************************************************************4451 4270 * IsMenu (USER32.@) 4452 4271 */ … … 4790 4609 } 4791 4610 4792 /*******************************************************************4793 * InsertMenuItem (USER.441)4794 *4795 * FIXME: untested4796 */4797 BOOL16 WINAPI InsertMenuItem16( HMENU16 hmenu, UINT16 pos, BOOL16 byposition,4798 const MENUITEMINFO16 *mii )4799 {4800 MENUITEMINFOA miia;4801 4802 miia.cbSize = sizeof(miia);4803 miia.fMask = mii->fMask;4804 miia.dwTypeData = (LPSTR)mii->dwTypeData;4805 miia.fType = mii->fType;4806 miia.fState = mii->fState;4807 miia.wID = mii->wID;4808 miia.hSubMenu = mii->hSubMenu;4809 miia.hbmpChecked = mii->hbmpChecked;4810 miia.hbmpUnchecked = mii->hbmpUnchecked;4811 miia.dwItemData = mii->dwItemData;4812 miia.cch = mii->cch;4813 if (IS_STRING_ITEM(miia.fType))4814 miia.dwTypeData = MapSL(mii->dwTypeData);4815 return InsertMenuItemA( hmenu, pos, byposition, &miia );4816 }4817 4818 4611 4819 4612 /********************************************************************** … … 4878 4671 4879 4672 /********************************************************************** 4880 * CheckMenuRadioItem (USER.666)4881 */4882 BOOL16 WINAPI CheckMenuRadioItem16(HMENU16 hMenu,4883 UINT16 first, UINT16 last, UINT16 check,4884 BOOL16 bypos)4885 {4886 return CheckMenuRadioItem (hMenu, first, last, check, bypos);4887 }4888 4889 /**********************************************************************4890 4673 * GetMenuItemRect (USER32.@) 4891 4674 * … … 5001 4784 5002 4785 /********************************************************************** 5003 * SetMenuContextHelpId (USER.384)5004 */5005 BOOL16 WINAPI SetMenuContextHelpId16( HMENU16 hMenu, DWORD dwContextHelpID)5006 {5007 return SetMenuContextHelpId( hMenu, dwContextHelpID );5008 }5009 5010 5011 /**********************************************************************5012 4786 * SetMenuContextHelpId (USER32.@) 5013 4787 */ … … 5024 4798 } 5025 4799 return FALSE; 5026 }5027 5028 /**********************************************************************5029 * GetMenuContextHelpId (USER.385)5030 */5031 DWORD WINAPI GetMenuContextHelpId16( HMENU16 hMenu )5032 {5033 return GetMenuContextHelpId( hMenu );5034 4800 } 5035 4801
Note:
See TracChangeset
for help on using the changeset viewer.