- Timestamp:
- Jul 17, 1999, 8:30:52 PM (26 years ago)
- 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:38sandervl Exp $ */1 /* $Id: oslibwin.cpp,v 1.9 1999-07-17 18:30:51 sandervl Exp $ */ 2 2 /* 3 3 * Window API wrappers for OS/2 … … 42 42 HWND hwndClient; 43 43 RECTL rectl; 44 45 dprintf(("WinCreateWindow %x %x %x %s", hwndParent, dwWinStyle, dwFrameStyle, pszName)); 44 46 45 47 if(pszName && *pszName == 0) { … … 181 183 182 184 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); 187 186 } 188 187 return WinSetWindowPos(hwnd, hwndInsertBehind, x, y, cx, cy, fl); … … 297 296 //****************************************************************************** 298 297 //****************************************************************************** 299 298 inline ULONG OS2TOWIN32POINT(RECTL *parent, RECTL *child, ULONG y) 299 { 300 return (parent->yTop - parent->yBottom - (child->yTop - child->yBottom) - y - 1); 301 } 302 //****************************************************************************** 303 //****************************************************************************** 304 ULONG 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 //****************************************************************************** 316 ULONG 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 //****************************************************************************** 328 ULONG MapOS2ToWin32Y(PRECTL rectParent, PRECTL rectChild, ULONG y) 329 { 330 return OS2TOWIN32POINT(rectParent, rectChild, y); 331 } 332 //****************************************************************************** 333 //****************************************************************************** 334 ULONG 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 //****************************************************************************** 343 ULONG 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:38sandervl Exp $ */1 /* $Id: oslibwin.h,v 1.8 1999-07-17 18:30:51 sandervl Exp $ */ 2 2 /* 3 3 * Window API wrappers for OS/2 … … 12 12 #ifndef __OSLIBWIN_H__ 13 13 #define __OSLIBWIN_H__ 14 15 #define OS2TOWIN32POINT(height, y) (height - y)16 14 17 15 #define OSLIB_HWND_DESKTOP 0 … … 92 90 BOOL OSLibWinGetMsg(LPMSG pMsg, HWND hwnd, UINT uMsgFilterMin, UINT uMsgFilterMax, BOOL isUnicode = FALSE); 93 91 92 93 ULONG MapOS2ToWin32Y(HWND hwndChild); 94 ULONG MapOS2ToWin32Y(HWND hwndChild, ULONG y); 95 ULONG MapOS2ToWin32Y(PRECTL rectParent, PRECTL rectChild, ULONG y); 96 ULONG MapOS2ToWin32Y(PRECTL rectParent, HWND hwndChild, ULONG y); 97 ULONG MapOS2ToWin32Y(HWND hwndChild, PRECTL rectChild, ULONG y); 98 94 99 #endif //__OSLIBWIN_H__ -
trunk/src/user32/new/pmwindow.cpp
r323 r324 1 /* $Id: pmwindow.cpp,v 1. 6 1999-07-17 15:23:38sandervl Exp $ */1 /* $Id: pmwindow.cpp,v 1.7 1999-07-17 18:30:51 sandervl Exp $ */ 2 2 /* 3 3 * Win32 Window Managment Code for OS/2 … … 164 164 case WM_MOVE: 165 165 { 166 RECTL rectl, rectl2; 167 POINTL point; 168 HWND hwndParent; 169 ULONG xScreen, yScreen, yParent, xParent; 166 RECTL rectChild; 167 ULONG xParent, yParent; 170 168 171 169 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; 216 179 } 217 180 break; … … 266 229 goto RunDefWndProc; 267 230 } 268 269 231 break; 270 232 } -
trunk/src/user32/new/win32wnd.cpp
r323 r324 1 /* $Id: win32wnd.cpp,v 1. 7 1999-07-17 15:23:38sandervl Exp $ */1 /* $Id: win32wnd.cpp,v 1.8 1999-07-17 18:30:51 sandervl Exp $ */ 2 2 /* 3 3 * Win32 Window Code for OS/2 … … 27 27 #include "hooks.h" 28 28 #include <oslibwin.h> 29 #include <oslibutil.h> 29 30 30 31 #define HAS_DLGFRAME(style,exStyle) \ … … 662 663 //****************************************************************************** 663 664 //****************************************************************************** 664 ULONG Win32Window::MsgMove(ULONG x Screen, ULONG yScreen, ULONG xParent, ULONG yParent)665 ULONG Win32Window::MsgMove(ULONG xParent, ULONG yParent) 665 666 { 666 667 return 0; … … 731 732 return 1; 732 733 } 733 return SendMessageA(win32msg, 0, MAKELONG(x, OS2TOWIN32POINT(height, y)));734 return SendMessageA(win32msg, 0, MAKELONG(x, MapOS2ToWin32Y(OS2Hwnd, y))); 734 735 } 735 736 //****************************************************************************** -
trunk/src/user32/new/win32wnd.h
r321 r324 1 /* $Id: win32wnd.h,v 1. 6 1999-07-17 11:52:23sandervl Exp $ */1 /* $Id: win32wnd.h,v 1.7 1999-07-17 18:30:52 sandervl Exp $ */ 2 2 /* 3 3 * Win32 Window Code for OS/2 … … 58 58 ULONG MsgEnable(BOOL fEnable); 59 59 ULONG MsgShow(BOOL fShow); 60 ULONG MsgMove(ULONG x Screen, ULONG yScreen, ULONG xParent, ULONG yParent);60 ULONG MsgMove(ULONG xParent, ULONG yParent); 61 61 ULONG MsgSize(ULONG width, ULONG height, BOOL fMinimize, BOOL fMaximize); 62 62 ULONG MsgActivate(BOOL fActivate, HWND hwnd);
Note:
See TracChangeset
for help on using the changeset viewer.