Changeset 324 for trunk/src


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

* empty log message *

Location:
trunk/src/user32/new
Files:
5 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//******************************************************************************
  • trunk/src/user32/new/oslibwin.h

    r323 r324  
    1 /* $Id: oslibwin.h,v 1.7 1999-07-17 15:23:38 sandervl Exp $ */
     1/* $Id: oslibwin.h,v 1.8 1999-07-17 18:30:51 sandervl Exp $ */
    22/*
    33 * Window API wrappers for OS/2
     
    1212#ifndef __OSLIBWIN_H__
    1313#define __OSLIBWIN_H__
    14 
    15 #define OS2TOWIN32POINT(height, y)      (height - y)
    1614
    1715#define OSLIB_HWND_DESKTOP      0
     
    9290BOOL  OSLibWinGetMsg(LPMSG pMsg, HWND hwnd, UINT uMsgFilterMin, UINT uMsgFilterMax, BOOL isUnicode = FALSE);
    9391
     92
     93ULONG MapOS2ToWin32Y(HWND hwndChild);
     94ULONG MapOS2ToWin32Y(HWND hwndChild, ULONG y);
     95ULONG MapOS2ToWin32Y(PRECTL rectParent, PRECTL rectChild, ULONG y);
     96ULONG MapOS2ToWin32Y(PRECTL rectParent, HWND hwndChild, ULONG y);
     97ULONG MapOS2ToWin32Y(HWND hwndChild, PRECTL rectChild, ULONG y);
     98
    9499#endif //__OSLIBWIN_H__
  • trunk/src/user32/new/pmwindow.cpp

    r323 r324  
    1 /* $Id: pmwindow.cpp,v 1.6 1999-07-17 15:23:38 sandervl Exp $ */
     1/* $Id: pmwindow.cpp,v 1.7 1999-07-17 18:30:51 sandervl Exp $ */
    22/*
    33 * Win32 Window Managment Code for OS/2
     
    164164    case WM_MOVE:
    165165    {
    166      RECTL  rectl, rectl2;
    167      POINTL point;
    168      HWND   hwndParent;
    169      ULONG  xScreen, yScreen, yParent, xParent;
     166      RECTL rectChild;
     167      ULONG xParent, yParent;
    170168
    171169        dprintf(("OS2: WM_MOVE %x", hwnd));
    172         rc = WinQueryWindowRect(hwnd, &rectl);
    173         if(rc == TRUE) {
    174                 point.x = rectl.xLeft;
    175                 point.y = rectl.yBottom;
    176 
    177                 //If the window has a parent, calculate position relative to that window
    178                 if((hwndParent = WinQueryWindow(hwnd, QW_PARENT)) != WinQueryDesktopWindow(hab, NULLHANDLE)) {
    179                         rc = WinMapWindowPoints(hwnd, hwndParent, &point, 1);
    180                         if(rc == FALSE) {
    181                                 dprintf(("WM_MOVE: WinMapWindowPoints (parent) failed!"));
    182                                 break;
    183                         }
    184                         rc = WinQueryWindowRect(hwndParent, &rectl2);
    185                         if(rc == FALSE) {
    186                                 dprintf(("WM_MOVE: WinQueryWindowRect(HWND_DESKTOP, &rectl) failed!"));
    187                                 break;
    188                         }
    189                         xParent = point.x;
    190                         yParent = OS2TOWIN32POINT(rectl2.yTop - rectl2.yBottom, point.y);
    191                 }
    192                 else    xParent = yParent = -1;
    193 
    194                 point.x = rectl.xLeft;
    195                 point.y = rectl.yBottom;
    196 
    197                 rc = WinMapWindowPoints(hwnd, HWND_DESKTOP, &point, 1);
    198                 if(rc == FALSE) {
    199                         dprintf(("WM_MOVE: WinMapWindowPoints (desktop) failed!"));
    200                         break;
    201                 }
    202                 rc = WinQueryWindowRect(HWND_DESKTOP, &rectl);
    203                 if(rc == FALSE) {
    204                         dprintf(("WM_MOVE: WinQueryWindowRect(HWND_DESKTOP, &rectl) failed!"));
    205                         break;
    206                 }
    207                 xScreen = point.x;
    208                 yScreen = OS2TOWIN32POINT(rectl.yTop - rectl.yBottom, point.y);
    209 
    210                 if(win32wnd->MsgMove(xScreen, yScreen, xParent, yParent)) {
    211                         goto RunDefWndProc;
    212                 }
    213         }
    214         else {
    215                 dprintf(("WM_MOVE: WinQueryWindowRect failed!"));
     170
     171        WinQueryWindowRect(hwnd, &rectChild);
     172
     173        //Calculate position relative to parent window (real window or desktop)
     174        xParent = rectChild.xLeft;
     175        yParent = MapOS2ToWin32Y(hwnd, &rectChild, rectChild.yBottom);
     176
     177        if(win32wnd->MsgMove(xParent, yParent)) {
     178                goto RunDefWndProc;
    216179        }
    217180        break;
     
    266229                goto RunDefWndProc;
    267230        }
    268 
    269231        break;
    270232    }
  • trunk/src/user32/new/win32wnd.cpp

    r323 r324  
    1 /* $Id: win32wnd.cpp,v 1.7 1999-07-17 15:23:38 sandervl Exp $ */
     1/* $Id: win32wnd.cpp,v 1.8 1999-07-17 18:30:51 sandervl Exp $ */
    22/*
    33 * Win32 Window Code for OS/2
     
    2727#include "hooks.h"
    2828#include <oslibwin.h>
     29#include <oslibutil.h>
    2930
    3031#define HAS_DLGFRAME(style,exStyle) \
     
    662663//******************************************************************************
    663664//******************************************************************************
    664 ULONG Win32Window::MsgMove(ULONG xScreen, ULONG yScreen, ULONG xParent, ULONG yParent)
     665ULONG Win32Window::MsgMove(ULONG xParent, ULONG yParent)
    665666{
    666667  return 0;
     
    731732                return 1;
    732733  }
    733   return SendMessageA(win32msg, 0, MAKELONG(x, OS2TOWIN32POINT(height, y)));
     734  return SendMessageA(win32msg, 0, MAKELONG(x, MapOS2ToWin32Y(OS2Hwnd, y)));
    734735}
    735736//******************************************************************************
  • trunk/src/user32/new/win32wnd.h

    r321 r324  
    1 /* $Id: win32wnd.h,v 1.6 1999-07-17 11:52:23 sandervl Exp $ */
     1/* $Id: win32wnd.h,v 1.7 1999-07-17 18:30:52 sandervl Exp $ */
    22/*
    33 * Win32 Window Code for OS/2
     
    5858         ULONG  MsgEnable(BOOL fEnable);
    5959         ULONG  MsgShow(BOOL fShow);
    60          ULONG  MsgMove(ULONG xScreen, ULONG yScreen, ULONG xParent, ULONG yParent);
     60         ULONG  MsgMove(ULONG xParent, ULONG yParent);
    6161         ULONG  MsgSize(ULONG width, ULONG height, BOOL fMinimize, BOOL fMaximize);
    6262         ULONG  MsgActivate(BOOL fActivate, HWND hwnd);
Note: See TracChangeset for help on using the changeset viewer.