Changeset 2577 for trunk/src


Ignore:
Timestamp:
Jan 30, 2000, 7:48:29 PM (26 years ago)
Author:
sandervl
Message:

Menu bugfixes

Location:
trunk/src/user32
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/user32/menu.cpp

    r2483 r2577  
    1 /* $Id: menu.cpp,v 1.12 2000-01-20 16:48:54 cbratschi Exp $*/
     1/* $Id: menu.cpp,v 1.13 2000-01-30 18:48:27 sandervl Exp $*/
    22/*
    33 * Menu functions
     
    32163216 *         GetMenuString32A    (USER32.268)
    32173217 */
    3218 INT WINAPI GetMenuStringA( HMENU hMenu, UINT wItemID,
    3219                                LPSTR str, INT nMaxSiz, UINT wFlags )
     3218INT WINAPI GetMenuStringA(HMENU hMenu, UINT wItemID,
     3219                          LPSTR str, INT nMaxSiz, UINT wFlags )
    32203220{
    32213221    MENUITEM *item;
    32223222
    3223     dprintf(("USER32: GetMenuStringA"));
     3223    dprintf(("USER32: GetMenuStringA %x %d %d %x", hMenu, wItemID, nMaxSiz, wFlags));
    32243224
    32253225    //TRACE("menu=%04x item=%04x ptr=%p len=%d flags=%04x\n",
    32263226    //             hMenu, wItemID, str, nMaxSiz, wFlags );
    3227     if (!str || !nMaxSiz) return 0;
    3228     str[0] = '\0';
    32293227    if (!(item = MENU_FindItem( &hMenu, &wItemID, wFlags ))) return 0;
    32303228    if (!IS_STRING_ITEM(item->fType)) return 0;
     3229    if (!str || !nMaxSiz) return strlen(item->text);
     3230    str[0] = '\0';
    32313231    lstrcpynA( str, item->text, nMaxSiz );
    32323232    //TRACE("returning '%s'\n", str );
     
    32473247    //TRACE("menu=%04x item=%04x ptr=%p len=%d flags=%04x\n",
    32483248    //             hMenu, wItemID, str, nMaxSiz, wFlags );
    3249     if (!str || !nMaxSiz) return 0;
    3250     str[0] = '\0';
    32513249    if (!(item = MENU_FindItem( &hMenu, &wItemID, wFlags ))) return 0;
    32523250    if (!IS_STRING_ITEM(item->fType)) return 0;
     3251    if (!str || !nMaxSiz) return strlen(item->text);
     3252    str[0] = '\0';
    32533253    lstrcpynAtoW( str, item->text, nMaxSiz );
    32543254    return lstrlenW(str);
     
    37733773            lpmenu->Height = 0;  /* Make sure we recalculate the size */
    37743774        }
    3775         if (IsWindowVisible(hWnd))
     3775//SvL: This fixes the menu in standard mine sweeper (window isn't visible
     3776//     when SetMenu is called)
     3777//        if (IsWindowVisible(hWnd))
    37763778            SetWindowPos( hWnd, 0, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE |
    37773779                        SWP_NOACTIVATE | SWP_NOZORDER | SWP_FRAMECHANGED );
     
    43164318     HWND referenceHwnd;
    43174319
    4318      dprintf(("USER32: GetMenuItemRect"));
    43194320     //TRACE("(0x%x,0x%x,%d,%p)\n", hwnd, hMenu, uItem, rect);
    43204321
     
    43254326     {
    43264327         itemMenu = (POPUPMENU*)hMenu;
    4327          if (itemMenu == NULL)
    4328              return FALSE;
     4328         if (itemMenu == NULL) {
     4329                SetLastError(ERROR_INVALID_PARAMETER);
     4330                return FALSE;
     4331         }
    43294332
    43304333         if(itemMenu->hWnd == 0)
     
    43334336     }
    43344337
    4335      if ((rect == NULL) || (item == NULL))
    4336          return FALSE;
    4337 
     4338     if ((rect == NULL) || (item == NULL)) {
     4339        SetLastError(ERROR_INVALID_PARAMETER);
     4340        return FALSE;
     4341     }
    43384342     *rect = item->rect;
    43394343
    43404344     MapWindowPoints(referenceHwnd, 0, (LPPOINT)rect, 2);
     4345     dprintf(("USER32: GetMenuItemRect %x %x %d (%d,%d)(%d,%d)", hwnd, hMenu, uItem, rect->left, rect->top, rect->right, rect->bottom));
    43414346
    43424347     return TRUE;
  • trunk/src/user32/win32wbasenonclient.cpp

    r2529 r2577  
    1 /* $Id: win32wbasenonclient.cpp,v 1.6 2000-01-27 17:21:09 cbratschi Exp $ */
     1/* $Id: win32wbasenonclient.cpp,v 1.7 2000-01-30 18:48:29 sandervl Exp $ */
    22/*
    33 * Win32 Window Base Class for OS/2 (non-client methods)
     
    10251025   */
    10261026
     1027  dprintf(("DoNCPaint %x %x %d", getWindowHandle(), clip, suppress_menupaint));
     1028
    10271029  if (!(hdc = GetDCEx( Win32Hwnd, (clip > 1) ? clip : 0, DCX_USESTYLE | DCX_WINDOW |
    10281030                      ((clip > 1) ?(DCX_INTERSECTRGN /*| DCX_KEEPCLIPRGN*/) : 0) ))) return;
     
    10361038    //CB: unknown WINE handling (clip == 1), clip client?
    10371039    GetRgnBox( clip, &rectClip );
    1038   } else
     1040  }
     1041  else
    10391042  {
    10401043    clip = 0;
     
    11391142
    11401143  ReleaseDC(Win32Hwnd,hdc);
     1144  dprintf(("**DoNCPaint %x DONE", getWindowHandle()));
    11411145}
    11421146//******************************************************************************
  • trunk/src/user32/windowmsg.cpp

    r2469 r2577  
    1 /* $Id: windowmsg.cpp,v 1.17 2000-01-18 20:11:10 sandervl Exp $ */
     1/* $Id: windowmsg.cpp,v 1.18 2000-01-30 18:48:29 sandervl Exp $ */
    22/*
    33 * Win32 window message APIs for OS/2
     
    130130    window = Win32BaseWindow::GetWindowFromHandle(hwnd);
    131131    if(!window) {
    132         dprintf(("SendMessageA, window %x not found", hwnd));
     132        dprintf(("SendMessageA, %x %x %x window %x not found", msg, wParam, lParam, hwnd));
    133133        return 0;
    134134    }
Note: See TracChangeset for help on using the changeset viewer.