Changeset 1732 for trunk/src


Ignore:
Timestamp:
Nov 14, 1999, 1:00:01 PM (26 years ago)
Author:
sandervl
Message:

WindowFromPoint fix + GetMenuItemRect implemented

Location:
trunk/src/user32
Files:
4 edited

Legend:

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

    r1513 r1732  
    1 /* $Id: oslibmenu.cpp,v 1.4 1999-10-30 09:19:44 sandervl Exp $ */
     1/* $Id: oslibmenu.cpp,v 1.5 1999-11-14 12:00:01 sandervl Exp $ */
    22/*
    33 * Window Menu wrapper functions for OS/2
     
    7979}
    8080//******************************************************************************
     81//Returns menu item rectange in screen coordinates
     82//******************************************************************************
     83BOOL OSLibGetMenuItemRect(HWND hMenu, int index, LPRECT pRect)
     84{
     85  RECTL rectl;
     86  BOOL  rc;
     87  ULONG id;
     88
     89   //First get id from menu index
     90   id = (ULONG)WinSendMsg(hMenu, MM_ITEMIDFROMPOSITION, MPARAM(index), 0);
     91
     92   rc = (BOOL)WinSendMsg(hMenu, MM_QUERYITEMRECT, MPARAM(id), (MPARAM)&rectl);
     93   if(rc == FALSE) {
     94        dprintf(("OSLibGetMenuItemRect %x %d %d failed!", hMenu, index, id));
     95        return FALSE;
     96   }
     97   WinMapWindowPoints(hMenu, HWND_DESKTOP, (PPOINTL)&rectl, 2);
     98   pRect->left  = rectl.xLeft;
     99   pRect->right = rectl.xRight;
     100   pRect->top   = OSLibQueryScreenHeight() - rectl.yTop;
     101   pRect->bottom= OSLibQueryScreenHeight() - rectl.yBottom;
     102   return TRUE;
     103}
     104//******************************************************************************
    81105//******************************************************************************
    82106
  • trunk/src/user32/oslibmenu.h

    r1446 r1732  
    1 /* $Id: oslibmenu.h,v 1.3 1999-10-25 20:17:18 sandervl Exp $ */
     1/* $Id: oslibmenu.h,v 1.4 1999-11-14 12:00:01 sandervl Exp $ */
    22/*
    33 * Window Menu wrapper functions for OS/2
     
    2222HMENU OSLibWinCreateEmptyPopupMenu();
    2323int   OSLibGetMenuItemCount(HWND hMenu);
     24BOOL  OSLibGetMenuItemRect(HWND hMenu, int index, LPRECT pRect);
    2425 
    2526#endif //__OSLIBGDI_H__
  • trunk/src/user32/window.cpp

    r1704 r1732  
    1 /* $Id: window.cpp,v 1.34 1999-11-11 13:17:32 sandervl Exp $ */
     1/* $Id: window.cpp,v 1.35 1999-11-14 12:00:01 sandervl Exp $ */
    22/*
    33 * Win32 window apis for OS/2
     
    12471247HWND WIN32API WindowFromPoint( POINT point)
    12481248{
    1249  HWND hwnd;
    1250 
    1251     dprintf(("WindowFromPoint (%d,%d)\n", point.x, point.y));
    1252     hwnd = OSLibWinWindowFromPoint(OSLIB_HWND_DESKTOP, (PVOID)&point);
    1253     if(hwnd) {
    1254         return Win32BaseWindow::OS2ToWin32Handle(hwnd);
    1255     }
    1256     return 0;
     1249    HWND  hwndOS2, hwnd;
     1250    POINT wPoint;
     1251
     1252
     1253    wPoint.x = point.x;
     1254    wPoint.y = windowDesktop->getWindowHeight() - point.y;
     1255
     1256    hwndOS2 = OSLibWinWindowFromPoint(OSLIB_HWND_DESKTOP, (PVOID)&wPoint);
     1257    if(hwndOS2) {
     1258        hwnd = Win32BaseWindow::OS2ToWin32Handle(hwndOS2);
     1259        if(hwnd) {
     1260                dprintf(("WindowFromPoint (%d,%d) %x->%x\n", point.x, point.y, hwndOS2, hwnd));
     1261                return hwnd;
     1262        }
     1263    }
     1264    dprintf(("WindowFromPoint (%d,%d) %x->1\n", point.x, point.y, hwndOS2));
     1265    return 1;
    12571266}
    12581267//******************************************************************************
  • trunk/src/user32/winmenu.cpp

    r1675 r1732  
    1 /* $Id: winmenu.cpp,v 1.16 1999-11-09 20:15:11 sandervl Exp $ */
     1/* $Id: winmenu.cpp,v 1.17 1999-11-14 12:00:01 sandervl Exp $ */
    22
    33/*
     
    10731073 *             extended error information, use the GetLastError function.
    10741074 * Remark    :
    1075  * Status    : UNTESTED STUB
     1075 * Status    :
    10761076 *
    10771077 * Author    : Patrick Haller [Thu, 1998/02/26 11:55]
     
    10841084              LPRECT, lprcItem)
    10851085{
    1086   dprintf(("USER32:GetMenuItemRect (%08xh,%08xh,%08xh,%08x) not implemented.\n",
    1087          hWnd,
    1088          hMenu,
    1089          uItem,
    1090          lprcItem));
    1091 
    1092   return (FALSE);
     1086    return OSLibGetMenuItemRect(hMenu, uItem, lprcItem);
    10931087}
    10941088/*****************************************************************************
Note: See TracChangeset for help on using the changeset viewer.