Ignore:
Timestamp:
Jul 17, 1999, 8:30:52 PM (26 years ago)
Author:
sandervl
Message:

* empty log message *

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/user32/new/oslibwin.cpp

    r323 r324  
    1 /* $Id: oslibwin.cpp,v 1.8 1999-07-17 15:23:38 sandervl Exp $ */
     1/* $Id: oslibwin.cpp,v 1.9 1999-07-17 18:30:51 sandervl Exp $ */
    22/*
    33 * Window API wrappers for OS/2
     
    4242 HWND  hwndClient;
    4343 RECTL rectl;
     44
     45  dprintf(("WinCreateWindow %x %x %x %s", hwndParent, dwWinStyle, dwFrameStyle, pszName));
    4446
    4547  if(pszName && *pszName == 0) {
     
    181183
    182184  if(fl & SWP_MOVE) {
    183         hwndParent = WinQueryWindow(hwnd, QW_PARENT);
    184         if(WinQueryWindowRect(hwnd, &rectl)) {
    185                 y = OS2TOWIN32POINT(rectl.yTop - rectl.yBottom, y);
    186         }
     185        y = MapOS2ToWin32Y(hwnd, y);
    187186  }
    188187  return WinSetWindowPos(hwnd, hwndInsertBehind, x, y, cx, cy, fl);
     
    297296//******************************************************************************
    298297//******************************************************************************
    299 
     298inline ULONG OS2TOWIN32POINT(RECTL *parent, RECTL *child, ULONG y)
     299{
     300  return (parent->yTop - parent->yBottom - (child->yTop - child->yBottom) - y - 1);
     301}
     302//******************************************************************************
     303//******************************************************************************
     304ULONG MapOS2ToWin32Y(HWND hwndChild)
     305{
     306 HWND  hwndParent;
     307 RECTL rectParent = {0}, rectChild = {0};
     308
     309   WinQueryWindowRect(hwndChild, &rectChild);
     310   hwndParent = WinQueryWindow(hwndChild, QW_PARENT);
     311   WinQueryWindowRect(hwndParent, &rectParent);
     312   return OS2TOWIN32POINT(&rectParent, &rectChild, rectChild.yBottom);
     313}
     314//******************************************************************************
     315//******************************************************************************
     316ULONG MapOS2ToWin32Y(HWND hwndChild, ULONG y)
     317{
     318 HWND  hwndParent;
     319 RECTL rectParent = {0}, rectChild = {0};
     320
     321   WinQueryWindowRect(hwndChild, &rectChild);
     322   hwndParent = WinQueryWindow(hwndChild, QW_PARENT);
     323   WinQueryWindowRect(hwndParent, &rectParent);
     324   return OS2TOWIN32POINT(&rectParent, &rectChild, y);
     325}
     326//******************************************************************************
     327//******************************************************************************
     328ULONG MapOS2ToWin32Y(PRECTL rectParent, PRECTL rectChild, ULONG y)
     329{
     330   return OS2TOWIN32POINT(rectParent, rectChild, y);
     331}
     332//******************************************************************************
     333//******************************************************************************
     334ULONG MapOS2ToWin32Y(PRECTL rectParent, HWND hwndChild, ULONG y)
     335{
     336 RECTL rectChild = {0};
     337
     338   WinQueryWindowRect(hwndChild, &rectChild);
     339   return OS2TOWIN32POINT(rectParent, &rectChild, y);
     340}
     341//******************************************************************************
     342//******************************************************************************
     343ULONG MapOS2ToWin32Y(HWND hwndChild, PRECTL rectChild, ULONG y)
     344{
     345 HWND  hwndParent;
     346 RECTL rectParent = {0};
     347
     348   hwndParent = WinQueryWindow(hwndChild, QW_PARENT);
     349   WinQueryWindowRect(hwndParent, &rectParent);
     350   return OS2TOWIN32POINT(&rectParent, rectChild, y);
     351}
     352//******************************************************************************
     353//******************************************************************************
Note: See TracChangeset for help on using the changeset viewer.